I would suggest doing the string.Join
operation locally instead using AsEnumerable
:
var q = from i in _dbContext.Users
where i.UserId != null
select new
{
FirstName = i.FirstName,
LastName = i.LastName,
Question4Parts = _dbContext.MultipleQuestions
.Where(a => a.MultipleQuestionType.KEY ==
MultipleQuestionKeys.BENEFITS)
.Select(a => a.Question)
};
return q.AsEnumerable()
.Select(x => new ITW2012Mobile.ViewModels.AdminSurveyReportModel
{
FirstName = x.FirstName,
LastName = x.LastName,
Question4 = string.Join(", ", x.Question4Parts)
})
.ToList();