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