Ejemplo n.º 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());
        }
Ejemplo n.º 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"));
        }
Ejemplo n.º 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());
        }