public new static Expression <Func <UserOwnedQuestion, UserOwnedQuestionModel> > BuildModel() { var answerExp = AnswerModel.BuildUserOwnedModel(); return(x => new UserOwnedQuestionModel() { UserId = x.QuizzardUserId, Id = x.Id, QuestionText = x.QuestionText, Answers = x.UserOwnedAnswers.AsQueryable().Select(z => answerExp.Invoke(z)), QuestionTypeId = x.QuestionTypeId, UserOwned = true, ArchivedOn = x.ArchivedOn }); }
public static Expression <Func <Question, QuestionModel> > BuildModel() { var answerExpression = AnswerModel.BuildModel(); return(x => new QuestionModel() { Id = x.Id, QuizId = x.QuizId, QuestionText = x.QuestionText, CreatedOn = x.CreatedOn, QuestionTypeId = x.QuestionTypeId, UserOwned = false, ArchivedOn = x.ArchivedOn, Answers = x.QuestionAnswers.AsQueryable().Select(z => answerExpression.Invoke(z)) }); }