public void Add(ServiceType serviceType) { var request = new AddServiceTypeRequest(); request.ServiceType = serviceType; var response = HttpPost <AddServiceTypeRequest>("api/room/add", request, MediaType.Json); }
public AddServiceTypeResponse Add(AddServiceTypeRequest request) { try { var response = new AddServiceTypeResponse(); var bc = new ServiceTypeComponent(); response.Result = bc.Add(request.ServiceType); return(response); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }