// GET: ProgressReport public async Task <ActionResult> Index() { if (Request.IsAuthenticated) { var userId = User.Identity.GetUserId(); var progressreport = await _resultService.FindByAsync(i => i.UserId == userId); ProgressReportResource pr = new ProgressReportResource(); pr.ExamCount = progressreport.Count; pr.Win = progressreport.Where(j => j.ResultStatus == "Win").Count(); pr.Fail = progressreport.Where(j => j.ResultStatus == "Fail").Count(); return(View(pr)); } else { return(RedirectToAction("Login", "Account")); } }