public async Task <IActionResult> PutUser(int id, User user) { if (id != user.U_id) { return(BadRequest()); } _context.Entry(user).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutNotice(int id, Notice notice) { if (id != notice.Id) { return(BadRequest()); } _context.Entry(notice).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NoticeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }