Beispiel #1
0
        static LotteryAnalyseNormManager()
        {
            _analyseNormAppService = ServiceLocator.Current.GetInstance <ILotteryAnalyseNormAppService>();
            _lotteryAnalyseNorms   = _analyseNormAppService.GetAllEnable();

            foreach (var item in _lotteryAnalyseNorms)
            {
                var lotteryAnalyseNorm = string.Format(LsConstant.LotteryAnalyseNormRedisKey, item.Key);
                if (RedisHelper.KeyExists(lotteryAnalyseNorm))
                {
                    RedisHelper.KeyDelete(lotteryAnalyseNorm);
                }
                //foreach (var anlyse in item.Value)
                //{

                //    RedisHelper.SetHash(lotteryAnalyseNorm, anlyse.Id,anlyse);
                //}

                Parallel.ForEach(item.Value, new ParallelOptions()
                {
                    MaxDegreeOfParallelism = LsConstant.MaxDegreeOfParallelism,
                }, anlyse =>
                {
                    RedisHelper.SetHash(lotteryAnalyseNorm, anlyse.Id, anlyse);
                });
            }
        }
 public LotteryController(ILotteryDataAppService lotteryDataAppService,
                          ILotteryPlanManager lotteryPlanManager,
                          ILotteryAnalyseNormAppService analyseNormAppService)
 {
     _lotteryDataAppService = lotteryDataAppService;
     _lotteryPlanManager    = lotteryPlanManager;
     _analyseNormAppService = analyseNormAppService;
 }