/// <summary> /// Controller of the class that reads data from the database /// </summary> public ProblemSolutionsController() { solutionPOCOs = sm.GetAll().Result.Cast <ProblemSolution>().ToList(); solutions = (from x in solutionPOCOs select dc.Convert_ProblemSolutionPOCOToView(x)).ToList(); problems = pm.GetAll().Result.Cast <Problem>().ToList(); //these ViewBags are needed for filtering the data ViewBag.Names = solutions.Select(x => x.UserFullName).Distinct().ToList(); ViewBag.RequestDescs = solutions.Select(x => x.RequestDescription).Distinct().ToList(); ViewBag.Finished = solutions.Select(x => x.Status).Distinct().ToList(); ViewBag.StartsD = solutions.Select(x => x.StartDate).Distinct().ToList(); ViewBag.EndsD = solutions.Select(x => x.EndDate).Distinct().ToList(); ViewBag.Comments = solutions.Select(x => x.Comment).Distinct().ToList(); }