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