I have this code:
var questionCategory = questionnaire.QuestionCategories
.First(x => x.Type == (int)questionCategoryType);
return questionCategory.Questions.Select(x => new
{
Id = x.Id,
Text = x.Text,
});
I'm interested if there is a way of shortening this into one statement, i.e. avoid making variable questionCategory . I'm looking for Extesion method or LINQ solution, or little bit of both :) .