示例#1
0
        public IActionResult List(Question.SortField sort = Question.SortField.SubmissionTime, bool ascending = false)
        {
            var questions = _questionsService.GetAll(new IQuestionsService.GetAllOptions(sort, ascending));

            return(View(new QuestionListModel
            {
                SortField = sort,
                Ascending = ascending,
                Questions = questions.Select(x => new QuestionListItemModel(x)).ToList()
            }));
        }
示例#2
0
 public GetAllOptions(Question.SortField sort, bool ascending)
 {
     Sort      = sort;
     Ascending = ascending;
 }