// GET: HelpQueue/HelpQueue/{id?} public async Task <ActionResult> Queue(int?id) { var service = new CohortService(User.Identity.GetUserId()); CohortDetail model = null; if (User.IsInRole("Student")) { model = await service.GetUserCohortDetailAsync(User.Identity.GetUserId()); if (model is null) { return(RedirectToAction(nameof(InactiveAccount))); } } else if (id.HasValue) { model = await service.GetCohortById(id.Value); } if (model is null) { return(RedirectToAction(nameof(Index))); } return(View(model)); }