public async Task <IActionResult> Create([Bind("Id,Department")] Dept dept) { if (ModelState.IsValid) { _context.Add(dept); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(dept)); }
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)); }