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