public HttpResponseMessage UpdateIFRSProduct(HttpRequestMessage request, [FromBody] IFRSProduct productModel) { return(GetHttpResponse(request, () => { var product = _LoanService.UpdateIFRSProduct(productModel); return request.CreateResponse <IFRSProduct>(HttpStatusCode.OK, product); })); }
public HttpResponseMessage GetIFRSProduct(HttpRequestMessage request, int productId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; IFRSProduct product = _LoanService.GetIFRSProduct(productId); // notice no need to create a seperate model object since IFRSProduct entity will do just fine response = request.CreateResponse <IFRSProduct>(HttpStatusCode.OK, product); return response; })); }
public HttpResponseMessage DeleteIFRSProduct(HttpRequestMessage request, [FromBody] int productId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data IFRSProduct product = _LoanService.GetIFRSProduct(productId); if (product != null) { _LoanService.DeleteIFRSProduct(productId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No product found under that ID."); } return response; })); }
public IFRSProduct UpdateIFRSProduct(IFRSProduct ifrsProduct) { return(Channel.UpdateIFRSProduct(ifrsProduct)); }