public HttpResponseMessage GetHistoricalSectorialPD(HttpRequestMessage request, int historicalSectorialPDId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                HistoricalSectorialPD historicalSectorialPD = _IFRS9Service.GetHistoricalSectorialPD(historicalSectorialPDId);

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

                return response;
            }));
        }
        public HttpResponseMessage DeleteHistoricalSectorialPD(HttpRequestMessage request, [FromBody] int historicalSectorialPDId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                HistoricalSectorialPD historicalSectorialPD = _IFRS9Service.GetHistoricalSectorialPD(historicalSectorialPDId);

                if (historicalSectorialPD != null)
                {
                    _IFRS9Service.DeleteHistoricalSectorialPD(historicalSectorialPDId);

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

                return response;
            }));
        }
        public HttpResponseMessage UpdateHistoricalSectorialPD(HttpRequestMessage request, [FromBody] HistoricalSectorialPD historicalSectorialPDModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var historicalSectorialPD = _IFRS9Service.UpdateHistoricalSectorialPD(historicalSectorialPDModel);

                return request.CreateResponse <HistoricalSectorialPD>(HttpStatusCode.OK, historicalSectorialPD);
            }));
        }