public HttpResponseMessage UpdateSolutionRunDate(HttpRequestMessage request, [FromBody] SolutionRunDate solutionRunDateModel) { return(GetHttpResponse(request, () => { solutionRunDateModel.Active = true; var solutionRunDate = _ExtractionProcessService.UpdateSolutionRunDate(solutionRunDateModel); return request.CreateResponse <SolutionRunDate>(HttpStatusCode.OK, solutionRunDate); })); }
public HttpResponseMessage GetSolutionRunDate(HttpRequestMessage request, int solutionRunDateId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; SolutionRunDate solutionRunDate = _ExtractionProcessService.GetSolutionRunDate(solutionRunDateId); // notice no need to create a seperate model object since SolutionRunDate entity will do just fine response = request.CreateResponse <SolutionRunDate>(HttpStatusCode.OK, solutionRunDate); return response; })); }
public HttpResponseMessage DeleteSolutionRunDate(HttpRequestMessage request, [FromBody] int solutionRunDateId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data SolutionRunDate solutionRunDate = _ExtractionProcessService.GetSolutionRunDate(solutionRunDateId); if (solutionRunDate != null) { _ExtractionProcessService.DeleteSolutionRunDate(solutionRunDateId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No solutionRunDate found under that ID."); } return response; })); }
public SolutionRunDate UpdateSolutionRunDate(SolutionRunDate solutionRunDate) { return(Channel.UpdateSolutionRunDate(solutionRunDate)); }