Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }