Esempio n. 1
0
            public override async Task RunAsync()
            {
                int liveRoomCount = await Collector.CollectRoomCountAsync("0").ConfigureAwait(true);

                ShowLogInfo(liveRoomCount.ToString());
                var item = BilibiliLiveRoomCount.Create(liveRoomCount);

                using var context = new BilibiliDbContext(DbConfig);
                context.Database.EnsureCreated();
                context.LiveRoomCount.Add(item);
                await context.SaveChangesAsync();
            }
Esempio n. 2
0
            public override async Task RunAsync()
            {
                Collector.BeforeCollectAsync();
                int liveRoomCount = await Collector.CollectAsync("0");

                ShowLogInfo(liveRoomCount.ToString());
                using (var context = new BilibiliLiveRoomCountMySqlContext())
                {
                    context.Database.EnsureCreated();
                    var item = BilibiliLiveRoomCount.Create(liveRoomCount);
                    context.LiveRoomCount.Add(item);
                    context.SaveChanges();
                }
            }