Esempio n. 1
0
        public IActionResult OnGet(int courseId)
        {
            Course = _courseData.GetById(courseId);

            if (Course == null)
            {
                return(RedirectToPage("./NotFound"));
            }

            return(Page());
        }
Esempio n. 2
0
        public IActionResult OnGet(int?courseId)
        {
            if (courseId.HasValue)
            {
                Course = _courseData.GetById(courseId.Value);
            }
            else
            {
                Course = new Course {
                    Teacher = new Teacher()
                };
            }

            if (Course == null)
            {
                return(RedirectToPage("./NotFound"));
            }

            return(Page());
        }