public HttpResponseMessage UpdateSectorMapping(HttpRequestMessage request, [FromBody] SectorMapping sectorMappingModel) { return(GetHttpResponse(request, () => { var sectorMapping = _IFRS9Service.UpdateSectorMapping(sectorMappingModel); return request.CreateResponse <SectorMapping>(HttpStatusCode.OK, sectorMapping); })); }
public HttpResponseMessage GetSectorMapping(HttpRequestMessage request, int SectorMapping_Id) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; SectorMapping sectorMapping = _IFRS9Service.GetSectorMapping(SectorMapping_Id); // notice no need to create a seperate model object since SectorMapping entity will do just fine response = request.CreateResponse <SectorMapping>(HttpStatusCode.OK, sectorMapping); return response; })); }
public HttpResponseMessage DeleteSectorMapping(HttpRequestMessage request, [FromBody] int SectorMapping_Id) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data SectorMapping sectorMapping = _IFRS9Service.GetSectorMapping(SectorMapping_Id); if (sectorMapping != null) { _IFRS9Service.DeleteSectorMapping(SectorMapping_Id); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No sector mapping found under that ID."); } return response; })); }