public IQueryable <object> GetStatisticForCatalog(StatisticFilter filter) { return(this._dbContext.CatalogItemStatistic.Where(x => x.CreatedAt <= filter.To && x.CreatedAt >= filter.From) .Include(y => y.CatalogItem) .ThenInclude(z => z.Producer) .GroupBy(y => y.CatalogItem) .OrderByDescending(y => y.Count()) .Skip(filter.Offset) .Take(filter.Count) .Select(x => new { ProducerCode = x.Key.ProducerCode, ProducerName = x.Key.Producer.Name, RequestsCount = x.Count(), CreatedAt = x.FirstOrDefault().CreatedAt, CatalogItemEnName = x.Key.EnName, CatalogItemRuName = x.Key.RuName })); }
public IActionResult GetStatisticForCatalog([FromBody] StatisticFilter model) { var statistic = this._statisticService.GetStatisticForCatalog(model); return(Ok(statistic)); }
public IQueryable <object> GetStatisticForCatalog(StatisticFilter filter) { return(this._catalogItemStatisticRepository.GetStatisticForCatalog(filter)); }