public async Task <IActionResult> PutAccommodationFacility(int id, AccommodationFacility accommodationFacility) { if (id != accommodationFacility.id) { return(BadRequest()); } _context.Entry(accommodationFacility).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AccommodationFacilityExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <AccommodationFacility> > PostAccommodationFacility(AccommodationFacility accommodationFacility) { _context.AccommodationFacility.Add(accommodationFacility); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAccommodationFacility", new { id = accommodationFacility.id }, accommodationFacility)); }