public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.BoardGames.Add(BoardGame); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <int> SaveChanges() { return(await Db.SaveChangesAsync()); }