public async Task <IActionResult> Edit(int id, [Bind("ID,Name,IsDelete")] Type @type) { if (id != @type.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(@type); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TypeExists(@type.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(@type)); }
public async Task <IActionResult> Create([Bind("ID,Name,IsDelete")] Type @type) { _context.Add(@type); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); return(View(@type)); }