public IActionResult Detail(Guid?id) { using (var client = new DisciplineRepository()) { DisciplineEntity entity = client.FindById(id); if (entity == null) { return(View("NotFoundPageView", new NotFoundPageView { Action = "Detail", Controller = "Discipline", Title = "Выберите одну из дисциплин", Message = "Не удалось найти выбранную дисциплину", EntitySelectList = new SelectList(client.TakeAll(), "DisciplineId", "DisciplineName"), ReturnUrl = "Question/Index" })); } return(View(entity.AsDetailView())); } }