public IHttpActionResult PutReservation_Source(int id, Reservation_Source reservation_Source) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != reservation_Source.Id) { return BadRequest(); } try { _Reservation_SourceService.Update(reservation_Source); } catch (DbUpdateConcurrencyException) { if (!Reservation_SourceExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public IHttpActionResult PostReservation_Source(Reservation_Source reservation_Source) { if (!ModelState.IsValid) { return BadRequest(ModelState); } _Reservation_SourceService.Create(reservation_Source); return CreatedAtRoute("DefaultApi", new { id = reservation_Source.Id }, reservation_Source); }