public async Task <IActionResult> OnGetAsync(Guid id)
        {
            var spec = new CourseWithTeacherSpecification(id);

            Course = await _courseService.GetModelWithSpec(spec);

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

            return(Page());
        }
Example #2
0
        public async Task <IActionResult> OnGetAsync(Guid id)
        {
            var spec = new CourseWithTeacherSpecification(id);

            Course = await _courseService.GetModelWithSpec(spec);

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

            var teachers = await _teacherService.GetAsync();

            ViewData["TeacherName"] =
                new SelectList(teachers.Select(t => new { Id = t.Id, FullName = $"{t.FirstName} {t.LastName}" }), "Id",
                               "FullName");

            return(Page());
        }
        public async Task OnGetAsync()
        {
            var spec = new CourseWithTeacherSpecification();

            Course = await _service.ListAsync(spec);
        }