Пример #1
0
        public List <QuestionsDataModel> list()
        {
            //repositoryGateWay = new RepositoryGateWay<Questions>();
            //RepositoryGateWay<QuestionAnswers> QuestionAnswersRepositoryGateWay = new RepositoryGateWay<QuestionAnswers>();
            ContextGateway <Questions> .GetContextInstance();

            return(ContextGateway <Questions> .List(l => l.Id == l.Id, i => i.QuestionAnswers).Select
                       (s => new QuestionsDataModel
            {
                Id = s.Id,
                QuestionText = s.QuestionText,
                QuestionAnswersDataModel
                    = (from qa in s.QuestionAnswers
                       select new QuestionAnswersDataModel
                {
                    QuestionId = qa.QuestionId,
                    AnswerText = qa.AnswerText,
                    IsCorrext = qa.IsCorrect,
                    Id = qa.Id
                }).ToList()
            }).ToList());
        }
Пример #2
0
 public DifficultyLevelsOperations()
 {
     ContextGateway <DifficultyLevels> .GetContextInstance();
 }