コード例 #1
0
        public void GetBetDetails()
        {
            var service = new SportsbookService();

            var criteria = new InsertBetDetailBatchCriteria
            {
                BetDetailResult = service.GetBetDetail().GetAwaiter().GetResult()
            };

            var repository = new BetDetailRepository();

            repository.InsertBetDetailBatch(criteria);
        }
コード例 #2
0
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            while (!stoppingToken.IsCancellationRequested)
            {
                try
                {
                    var service = new SportsbookService();

                    var criteria = new InsertBetDetailBatchCriteria
                    {
                        BetDetailResult = await service.GetBetDetail()
                    };

                    var repository = new BetDetailRepository();
                    repository.InsertBetDetailBatch(criteria);
                    await Task.Delay(5000, stoppingToken);
                }
                catch (Exception ex)
                {
                    logger.LogError(ex.Message);
                }
            }
        }