public HttpResponseMessage UpdateThreshold(HttpRequestMessage request, [FromBody] SCDThreshold thresholdModel) { return(GetHttpResponse(request, () => { var threshold = _ScorecardService.UpdateSCDThreshold(thresholdModel); return request.CreateResponse <SCDThreshold>(HttpStatusCode.OK, threshold); })); }
public HttpResponseMessage GetThreshold(HttpRequestMessage request, int thresholdId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; SCDThreshold threshold = _ScorecardService.GetSCDThreshold(thresholdId); // notice no need to create a seperate model object since Threshold entity will do just fine response = request.CreateResponse <SCDThreshold>(HttpStatusCode.OK, threshold); return response; })); }
public HttpResponseMessage DeleteThreshold(HttpRequestMessage request, [FromBody] int thresholdId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data SCDThreshold threshold = _ScorecardService.GetSCDThreshold(thresholdId); if (threshold != null) { _ScorecardService.DeleteSCDThreshold(thresholdId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No threshold found under that ID."); } return response; })); }
public SCDThreshold UpdateSCDThreshold(SCDThreshold scdThreshold) { return(Channel.UpdateSCDThreshold(scdThreshold)); }