Пример #1
0
        public bool HealthCheck()
        {
            var request  = new RestRequest("api/Home/HealtCheck", Method.GET);
            var response = _client.Execute(request);

            return(response.StatusCode == HttpStatusCode.OK);
        }
Пример #2
0
        public double MultiCorrelationCoefficient(IEnumerable <DeterminingMultiCorrelationModel> data)
        {
            var request = new RestRequest("/api/Determining/ProbablePastime/MultiCorrelationCoefficient", Method.POST)
            {
                RequestFormat = DataFormat.Json
            };
            var csv = CsvSerializer.SerializeToString(data);

            request.AddBody(csv);

            var response = _client.Execute(request);

            if (response.StatusCode == HttpStatusCode.OK)
            {
                return(JsonSerializer.DeserializeFromString <double>(response.Content));
            }

            throw new AnalysisServiceUnavailableException();
        }
        public IEnumerable <IEnumerable <double> > CorrelationAnalysis(IEnumerable <ForecastingCorrelationModel> data)
        {
            var request = new RestRequest("api/Forecasting/ActualingTrips/CorrelationAnalysis", Method.POST)
            {
                RequestFormat = DataFormat.Json
            };
            var csv = CsvSerializer.SerializeToString(data);

            request.AddBody(csv);

            var response = _client.Execute(request);

            if (response.StatusCode == HttpStatusCode.OK)
            {
                return(JsonSerializer.DeserializeFromString <IEnumerable <IEnumerable <double> > >(response.Content));
            }

            throw new AnalysisServiceUnavailableException();
        }