示例#1
0
        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;
            }));
        }
示例#2
0
        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;
            }));
        }
示例#3
0
        public HttpResponseMessage UpdateSectorVariableMapping(HttpRequestMessage request, [FromBody] SectorVariableMapping sectorVariableMappingModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var sectorVariableMapping = _IFRS9Service.UpdateSectorVariableMapping(sectorVariableMappingModel);

                return request.CreateResponse <SectorVariableMapping>(HttpStatusCode.OK, sectorVariableMapping);
            }));
        }