Esempio n. 1
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                this.Error = "Something went wrong. Try Again.";
                return(Page());
            }

            var courseID = this.CourseID;

            this.Objective.CourseID  = courseID;
            this.Objective.DateAdded = DateTime.Now;

            await _context.AddObjectiveAsync(this.Objective);

            return(RedirectToPage("./List", new { courseID }));
        }