Example #1
0
        private async Task <double> GetLeaver(DsRequest request)
        {
            double leaver;
            string memKey = "leaver" + request.StartTime.ToString("yyyyMMdd") + request.EndTime.ToString("yyyyMMdd");

            if (!memoryCache.TryGetValue(memKey, out leaver))
            {
                leaver = await StatsService.GetLeaver(context, request);

                memoryCache.Set(memKey, leaver, CacheService.BuildCacheOptions);
            }
            return(leaver);
        }