public async Task <IActionResult> PutAppartment(Guid id, Appartment appartment) { if (id != appartment.AppartmentId) { return(BadRequest()); } _context.Entry(appartment).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AppartmentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutHotel(Guid id, Hotel hotel) { if (id != hotel.HotelId) { return(BadRequest()); } _context.Entry(hotel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HotelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutSafe(Guid id, Safe safe) { if (id != safe.SafeId) { return(BadRequest()); } UpdatePinIfSpecified(safe); _context.Entry(safe).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SafeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }