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