Пример #1
0
        public async Task <ItemStatisticResponseModel> GetItemStatisticAsync(ItemRequestModel requestModel)
        {
            (int count, List <StatisticModelDAL> statisticModels) = await _itemRepository.GetItemStatisticAsync(requestModel.PageNumber);

            ItemStatisticResponseModel response = new ItemStatisticResponseModel {
                TotalCount      = count,
                StatisticModels = statisticModels.Select(statisticModelDAL => new StatisticModel {
                    Type  = statisticModelDAL.Type,
                    Count = statisticModelDAL.Count
                }).ToList()
            };

            return(response);
        }
Пример #2
0
        public async Task <ItemStatisticResponseModel> GetItemsStatistic([FromBody] ItemRequestModel requestModel)
        {
            ItemStatisticResponseModel responseModel = await _itemService.GetItemStatisticAsync(requestModel);

            return(responseModel);
        }