public async Task <IActionResult> Edit(int id, [Bind("Idroles,Tiporol")] Troles troles) { if (id != troles.Idroles) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(troles); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TrolesExists(troles.Idroles)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(troles)); }
public async Task <IActionResult> Create([Bind("Idroles,Tiporol")] Troles troles) { if (ModelState.IsValid) { _context.Add(troles); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(troles)); }