public async Task <IActionResult> Edit(int id, [Bind("Id,CreationTime,Message")] LogEntry logEntry) { if (id != logEntry.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(logEntry); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LogEntryExists(logEntry.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(logEntry)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Birthday,IsMale,Request")] User user) { if (id != user.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(user); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(user.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(user)); }