public async Task <IActionResult> Create([Bind("Id,Name")] Category category) { if (ModelState.IsValid) { _context.Add(category); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(category)); }
public async Task SaveChangesAsync() { await _context.SaveChangesAsync(); }