Beispiel #1
0
        protected override Task <List <AnfVisitStatistic> > GetStatisticalsAsync(StatisticLevels type, DateTime left, DateTime right)
        {
            var now = DateTime.Now;

            return(DbContext.Visits.AsNoTracking()
                   .Where(x => x.Time > left && x.Time <= right)
                   .GroupBy(x => x.Address)
                   .Select(x => new AnfVisitStatistic
            {
                Address = x.Key,
                Time = now,
                Type = type,
                Count = x.LongCount()
            }).ToListAsync());
        }
Beispiel #2
0
        protected override async Task <List <AnfWordUpdateStatistic> > GetStatisticalsAsync(StatisticLevels type, DateTime left, DateTime right)
        {
            var now   = DateTime.Now;
            var count = await DbContext.WordUpdateCount.AsNoTracking()
                        .Where(x => x.Time > left && x.Time <= right)
                        .LongCountAsync();

            return(new List <AnfWordUpdateStatistic>(1)
            {
                new AnfWordUpdateStatistic
                {
                    Count = count,
                    Time = now,
                    Type = type,
                }
            });
        }