public HttpResponseMessage GetInvestmentOthersECL(HttpRequestMessage request, int ecl_Id) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; InvestmentOthersECL investmentOthersECL = _IFRS9Service.GetInvestmentOthersECL(ecl_Id); // notice no need to create a seperate model object since InvestmentOthersECL entity will do just fine response = request.CreateResponse <InvestmentOthersECL>(HttpStatusCode.OK, investmentOthersECL); return response; })); }
public HttpResponseMessage DeleteInvestmentOthersECL(HttpRequestMessage request, [FromBody] int ecl_Id) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data InvestmentOthersECL investmentOthersECL = _IFRS9Service.GetInvestmentOthersECL(ecl_Id); if (investmentOthersECL != null) { _IFRS9Service.DeleteInvestmentOthersECL(ecl_Id); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No InvestmentOthersECL found under that ID."); } return response; })); }
public HttpResponseMessage UpdateInvestmentOthersECL(HttpRequestMessage request, [FromBody] InvestmentOthersECL investmentOthersECLModel) { return(GetHttpResponse(request, () => { var investmentOthersECL = _IFRS9Service.UpdateInvestmentOthersECL(investmentOthersECLModel); return request.CreateResponse <InvestmentOthersECL>(HttpStatusCode.OK, investmentOthersECL); })); }