예제 #1
0
        public async Task <List <BonusStatisticDto> > GetBonusStatisticAsync(BonusFilter bonusFilter, CancellationToken cancellationToken)
        {
            var sortBy = bonusFilter?.SortBy ?? "Title";

            if (sortBy != null & typeof(Bonus).GetProperty(sortBy) == null)
            {
                throw new ArgumentException(Resources.PropertyDoesNotExist);
            }

            var result = await _bonusRepository.GetBonusStatisticAsync(bonusFilter, cancellationToken);

            return(_mapper.Map <List <BonusStatisticDto> >(result));
        }