Example #1
0
        public async Task <IActionResult> OnGetAsync(Guid id)
        {
            var spec = new ExamWithCourseSpecification(id);

            Exam = await _service.GetModelWithSpec(spec);

            if (Exam == null)
            {
                return(NotFound());
            }

            return(Page());
        }
Example #2
0
        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"));
        }
Example #3
0
        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());
        }