public ActionResult Question(int categoryID) { Func <Question, bool> predicate = x => x.CategoryDictId == categoryID; var vM = _questionRepository.GetOverview(predicate).ToList(); if (Request.IsAjaxRequest()) { return(PartialView("_ListQUestion", vM)); } return(View(vM)); }
/// <summary> /// All category with question more than 2 but without question in List _questionWithGame /// </summary> private List <int> GetQuestionID() { int lvlQuestion = GetLvlQuestion(); var questionWithGame = GetQuestionWithGame(); Func <Question, bool> predicate = t2 => !questionWithGame.Any(t1 => t1 == t2.Id); var tmpQuestions = _questionRepository.GetOverview(predicate).ToList(); tmpQuestions = tmpQuestions.Where(x => (int)x.Level == lvlQuestion && !x.IsHidden).ToList(); return(tmpQuestions .GroupBy(x => x.CategoryDictId) .Where(x => x.Count() > 2) .Select(x => x.Key).ToList()); }