Ejemplo n.º 1
0
        static CheckedQuestionViewModel Build(CheckedQuestion model, short poolid)
        {
            var db         = new DBCache();
            var answers    = db.GetCheckedAnswers(poolid);
            var q          = new CheckedQuestionViewModel(model);
            var answersVMs = new List <CheckedAnswerViewModel>();
            var a          = answers.Single(x => x.Key == model.ID);

            foreach (var item in a)
            {
                answersVMs.Add(new CheckedAnswerViewModel(item, q));
            }
            q.Answers = answersVMs;
            return(q);
        }