public HttpResponseMessage GetProductTypeMapping(HttpRequestMessage request, int productTypeMappingId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; ProductTypeMapping productTypeMapping = _CoreService.GetProductTypeMapping(productTypeMappingId); // notice no need to create a seperate model object since ProductTypeMapping entity will do just fine response = request.CreateResponse <ProductTypeMapping>(HttpStatusCode.OK, productTypeMapping); return response; })); }
public HttpResponseMessage DeleteProductTypeMapping(HttpRequestMessage request, [FromBody] int productTypeMappingId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data ProductTypeMapping productTypeMapping = _CoreService.GetProductTypeMapping(productTypeMappingId); if (productTypeMapping != null) { _CoreService.DeleteProductTypeMapping(productTypeMappingId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No productTypeMapping found under that ID."); } return response; })); }
public ProductTypeMapping UpdateProductTypeMapping(ProductTypeMapping productTypeMapping) { return(Channel.UpdateProductTypeMapping(productTypeMapping)); }
public HttpResponseMessage UpdateProductTypeMapping(HttpRequestMessage request, [FromBody] ProductTypeMapping productTypeMappingModel) { return(GetHttpResponse(request, () => { var productTypeMapping = _CoreService.UpdateProductTypeMapping(productTypeMappingModel); return request.CreateResponse <ProductTypeMapping>(HttpStatusCode.OK, productTypeMapping); })); }