public HttpResponseMessage GetAccountTransferPrice(HttpRequestMessage request, int accounttransferpriceId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; AccountTransferPrice accounttransferprice = _MPRCoreService.GetAccountTransferPrice(accounttransferpriceId); // notice no need to create a seperate model object since AccountTransferPrice entity will do just fine response = request.CreateResponse <AccountTransferPrice>(HttpStatusCode.OK, accounttransferprice); return response; })); }
public HttpResponseMessage DeleteAccountTransferPrice(HttpRequestMessage request, [FromBody] int accounttransferpriceId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data AccountTransferPrice accounttransferprice = _MPRCoreService.GetAccountTransferPrice(accounttransferpriceId); if (accounttransferprice != null) { _MPRCoreService.DeleteAccountTransferPrice(accounttransferpriceId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No Account Transfer Price found under that ID."); } return response; })); }
public AccountTransferPrice UpdateAccountTransferPrice(AccountTransferPrice accountTransferPrice) { return(Channel.UpdateAccountTransferPrice(accountTransferPrice)); }
public HttpResponseMessage UpdateAccountTransferPrice(HttpRequestMessage request, [FromBody] AccountTransferPrice accounttransferpriceModel) { return(GetHttpResponse(request, () => { var accounttransferprice = _MPRCoreService.UpdateAccountTransferPrice(accounttransferpriceModel); return request.CreateResponse <AccountTransferPrice>(HttpStatusCode.OK, accounttransferprice); })); }