public async Task <IActionResult> Edit(Guid id, [Bind("Id,RoleId,Comment")] LarryRole larryRole) { if (id != larryRole.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(larryRole); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LarryRoleExists(larryRole.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(larryRole)); }
public async Task <IActionResult> Create([Bind("Id,RoleId,Comment")] LarryRole larryRole) { if (ModelState.IsValid) { larryRole.Id = Guid.NewGuid(); _context.Add(larryRole); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(larryRole)); }