public HttpResponseMessage GetRatios(HttpRequestMessage request, int caption_transfer_price_Id) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; caption_transfer_price ctp = _MPRCoreService.GetCaptionTransferPrice(caption_transfer_price_Id); // notice no need to create a seperate model object since CaptionMapping entity will do just fine response = request.CreateResponse <caption_transfer_price>(HttpStatusCode.OK, ctp); return response; })); }
public HttpResponseMessage DeleteCaptionTransferPrice(HttpRequestMessage request, [FromBody] int caption_transfer_price_Id) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data caption_transfer_price ctp = _MPRCoreService.GetCaptionTransferPrice(caption_transfer_price_Id); if (ctp != null) { _MPRCoreService.DeleteCaptionTransferPrice(caption_transfer_price_Id); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No caption transfer price found under that ID."); } return response; })); }
public HttpResponseMessage UpdateCaptionTransferPrice(HttpRequestMessage request, [FromBody] caption_transfer_price ctpModel) { return(GetHttpResponse(request, () => { var ctp = _MPRCoreService.UpdateCaptionTransferPrice(ctpModel); return request.CreateResponse <caption_transfer_price>(HttpStatusCode.OK, ctp); })); }