示例#1
0
        public object GetGenerateCache()
        {
            var s = new TimeseriesCache();

            s.GenerateCache((a, b, c, d) => GetTimeSeriesInner(a, b, c, d));

            return(Ok());
        }
示例#2
0
        public Entry[] GetTimeSeries(DateTime from, DateTime to, string element = defaultElement, string stations = defaultStations)
        {
            var intStations = stations.Split(',').Select(x => int.Parse(x)).ToArray();

            //check cache
            var cache = new TimeseriesCache();

            if (cache.IsCached(element, intStations))
            {
                return(cache
                       .ReadCache(element, intStations)
                       .Where(x => x.from >= from && x.from <= to)
                       .ToArray());
            }

            return(GetTimeSeriesInner(from, to, element, stations));
        }