public async Task <IActionResult> OnGetAsync(Guid id) { var spec = new ExamWithCourseSpecification(id); Exam = await _service.GetModelWithSpec(spec); if (Exam == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(Guid id) { var spec = new ExamWithCourseSpecification(id); Exam = await _service.GetModelWithSpec(spec); if (Exam != null) { await _service.DeleteAsync(Exam); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(Guid id) { var spec = new ExamWithCourseSpecification(id); Exam = await _examService.GetModelWithSpec(spec); if (Exam == null) { return(NotFound()); } var courses = (await _courseService.GetAsync()); ViewData["CourseTitle"] = new SelectList(courses, "Id", "Title"); return(Page()); }