public IHttpActionResult PostBranch(Branch branch) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Branch.Add(branch); db.Complete(); return(CreatedAtRoute("DefaultApi", new { id = branch.Id }, branch)); }
public IHttpActionResult PostVehicle(Vehicle vehicle) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Vehicle.Add(vehicle); db.Complete(); return(CreatedAtRoute("DefaultApi", new { id = vehicle.Id }, vehicle)); }
public IHttpActionResult PostRating(Rating rating) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Rating.Add(rating); db.Complete(); return(CreatedAtRoute("DefaultApi", new { id = rating.Id }, rating)); }
public IHttpActionResult PostService(Service service) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Service.Add(service); db.Complete(); return(CreatedAtRoute("DefaultApi", new { id = service.Id }, service)); }
public IHttpActionResult PostPictureConfirmation(PictureConfirmation pictureConfirmation) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.PictureConfirmation.Add(pictureConfirmation); db.Complete(); return(CreatedAtRoute("DefaultApi", new { id = pictureConfirmation.Id }, pictureConfirmation)); }
public IHttpActionResult PostReservation(Reservation reservation) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Reservation.Add(reservation); db.Complete(); return(CreatedAtRoute("DefaultApi", new { id = reservation.Id }, reservation)); }