public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _db.Attach(Member).State = EntityState.Modified; try { await _db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { throw new Exception($"Student {Member.MemberID} not found!"); } return(RedirectToPage("/MemberDB")); }