public HttpResponseMessage GetMonthlyDiscountFactor(HttpRequestMessage request, int MonthlyDiscountFactor_Id) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; MonthlyDiscountFactor monthlydiscountfactor = _IFRS9Service.GetMonthlyDiscountFactor(MonthlyDiscountFactor_Id); // notice no need to create a seperate model object since MonthlyDiscountFactor entity will do just fine response = request.CreateResponse <MonthlyDiscountFactor>(HttpStatusCode.OK, monthlydiscountfactor); return response; })); }
public HttpResponseMessage DeleteMonthlyDiscountFactor(HttpRequestMessage request, [FromBody] int MonthlyDiscountFactor_Id) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data MonthlyDiscountFactor monthlydiscountfactor = _IFRS9Service.GetMonthlyDiscountFactor(MonthlyDiscountFactor_Id); if (monthlydiscountfactor != null) { _IFRS9Service.DeleteMonthlyDiscountFactor(MonthlyDiscountFactor_Id); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No monthlydiscountfactor found under that Id."); } return response; })); }
public HttpResponseMessage UpdateMonthlyDiscountFactor(HttpRequestMessage request, [FromBody] MonthlyDiscountFactor monthlydiscountfactorModel) { return(GetHttpResponse(request, () => { var monthlydiscountfactor = _IFRS9Service.UpdateMonthlyDiscountFactor(monthlydiscountfactorModel); return request.CreateResponse <MonthlyDiscountFactor>(HttpStatusCode.OK, monthlydiscountfactor); })); }