public HttpResponseMessage UpdatePLCaption(HttpRequestMessage request, [FromBody] PLCaption plCaptionModel) { return(GetHttpResponse(request, () => { var plCaption = _MPRPLService.UpdatePLCaption(plCaptionModel); return request.CreateResponse <PLCaption>(HttpStatusCode.OK, plCaption); })); }
public HttpResponseMessage GetPLCaption(HttpRequestMessage request, int PLCaptionId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; PLCaption plCaption = _MPRPLService.GetPLCaption(PLCaptionId); // notice no need to create a seperate model object since PLCaption entity will do just fine response = request.CreateResponse <PLCaption>(HttpStatusCode.OK, plCaption); return response; })); }
public HttpResponseMessage DeletePLCaption(HttpRequestMessage request, [FromBody] int plCaptionId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data PLCaption plCaption = _MPRPLService.GetPLCaption(plCaptionId); if (plCaption != null) { _MPRPLService.DeletePLCaption(plCaptionId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No plCaption found under that ID."); } return response; })); }
public PLCaption UpdatePLCaption(PLCaption plCaption) { return(Channel.UpdatePLCaption(plCaption)); }