public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Code,Address")] ROMTestModel rOMTestModel) { if (id != rOMTestModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(rOMTestModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ROMTestModelExists(rOMTestModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(rOMTestModel)); }
public IActionResult Edit(Category category) { if (ModelState.IsValid) { _context.Update(category); _context.SaveChanges(); return(RedirectToAction("Index")); } return(View(category)); }