public async Task <IActionResult> PutBoilerStatus(long id, BoilerStatus boilerStatus) { if (id != boilerStatus.Id) { return(BadRequest()); } _context.Entry(boilerStatus).State = EntityState.Modified; boilerStatus.UpdateTime = DateTime.Now; boilerStatus.UserId = Constants.defaultUserName; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BoilerStatusExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutRoomStatus(long id, RoomStatus roomStatus) { if (id != roomStatus.Id) { return(BadRequest()); } _context.Entry(roomStatus).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoomStatusExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }