Ejemplo n.º 1
0
        public HttpResponseMessage GetHistoricalSectorialLGD(HttpRequestMessage request, int historicalSectorialLGDId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                HistoricalSectorialLGD historicalSectorialLGD = _IFRS9Service.GetHistoricalSectorialLGD(historicalSectorialLGDId);

                // notice no need to create a seperate model object since HistoricalSectorialLGD entity will do just fine
                response = request.CreateResponse <HistoricalSectorialLGD>(HttpStatusCode.OK, historicalSectorialLGD);

                return response;
            }));
        }
Ejemplo n.º 2
0
        public HttpResponseMessage DeleteHistoricalSectorialLGD(HttpRequestMessage request, [FromBody] int historicalSectorialLGDId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                HistoricalSectorialLGD historicalSectorialLGD = _IFRS9Service.GetHistoricalSectorialLGD(historicalSectorialLGDId);

                if (historicalSectorialLGD != null)
                {
                    _IFRS9Service.DeleteHistoricalSectorialLGD(historicalSectorialLGDId);

                    response = request.CreateResponse(HttpStatusCode.OK);
                }
                else
                {
                    response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No historicalSectorialLGD found under that ID.");
                }

                return response;
            }));
        }
Ejemplo n.º 3
0
        public HttpResponseMessage UpdateHistoricalSectorialLGD(HttpRequestMessage request, [FromBody] HistoricalSectorialLGD historicalSectorialLGDModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var historicalSectorialLGD = _IFRS9Service.UpdateHistoricalSectorialLGD(historicalSectorialLGDModel);

                return request.CreateResponse <HistoricalSectorialLGD>(HttpStatusCode.OK, historicalSectorialLGD);
            }));
        }