public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Deleted")] Groupnom groupnom) { if (id != groupnom.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(groupnom); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GroupnomExists(groupnom.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(groupnom)); }
public async Task <IActionResult> Create([Bind("Id,Name,Deleted")] Groupnom groupnom) { if (ModelState.IsValid) { _context.Add(groupnom); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(groupnom)); }