public IHttpActionResult PostPropertyService(PropertyServiceViewModel service) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } serviceRepository.UpdatePropertyService(service.MapTo <PropertyService>()); return(Ok(service)); }
public IHttpActionResult PutPropertyService(int id, PropertyServiceViewModel service) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != service.Id) { return(BadRequest()); } serviceRepository.UpdatePropertyService(service.MapTo <PropertyService>()); return(StatusCode(HttpStatusCode.NoContent)); }