public async Task <IActionResult> Edit(long id, [Bind("Iduser,Name,Email,Password,ConfirmedByEmail,IsAdmin")] SimpleUser simpleUser) { if (id != simpleUser.Iduser) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(simpleUser); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SimpleUserExists(simpleUser.Iduser)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(simpleUser)); }
public async Task <IActionResult> Edit(long id, [Bind("Idbook,IdtinRead,Title,Creator,Identifier,IsCorrect,ErrorMessage")] Book book) { if (id != book.Idbook) { return(NotFound()); } return(NotFound()); if (ModelState.IsValid) { try { _context.Update(book); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BookExists(book.Idbook)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(book)); }