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