コード例 #1
0
        public HttpResponseMessage UpdateThreshold(HttpRequestMessage request, [FromBody] SCDThreshold thresholdModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var threshold = _ScorecardService.UpdateSCDThreshold(thresholdModel);

                return request.CreateResponse <SCDThreshold>(HttpStatusCode.OK, threshold);
            }));
        }
コード例 #2
0
        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;
            }));
        }
コード例 #3
0
        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;
            }));
        }
コード例 #4
0
 public SCDThreshold UpdateSCDThreshold(SCDThreshold scdThreshold)
 {
     return(Channel.UpdateSCDThreshold(scdThreshold));
 }