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