Example #1
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            await store.InsertAsync(Student);

            return(RedirectToPage("/Student"));
        }
Example #2
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }


            if (Record.Total > 100)
            {
                return(Page());
            }

            await store.InsertAsync(Record);

            return(Redirect("/Record?courseId=" + Record.CourseId.ToString()));
        }