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