public HttpResponseMessage Post([FromBody] SaveFacilityParameter value) { ModelState.EnsureValidModelStateWithHttpResponseException(); var param = _userIdentityProvider.SetUserIdentity(value.Map().To <CreateFacilityParameters>()); var result = _facilityService.CreateFacility(param); return(result.ToHttpResponseMessage(HttpVerbs.Post)); }
public HttpResponseMessage Put(string id, [FromBody] SaveFacilityParameter value) { ModelState.EnsureValidModelStateWithHttpResponseException(); var param = _userIdentityProvider.SetUserIdentity(value.Map().To <UpdateFacilityParameters>()); param.FacilityKey = id; var result = _facilityService.UpdateFacility(param); return(result.ToHttpResponseMessage(HttpVerbs.Put)); }