public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Description,ClassType")] Region region) { if (id != region.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(region); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RegionExists(region.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(region)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] Types @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)); }