コード例 #1
0
        public async Task <IReadOnlyList <TierCustomersCount> > GetNumberOfCustomersPerTierAsync()
        {
            var tiers = await _tiersRepository.GetAllAsync();

            var result = new List <TierCustomersCount>();

            foreach (var tier in tiers)
            {
                result.Add(new TierCustomersCount
                {
                    Id             = tier.Id,
                    CustomersCount = await _customerTiersRepository.GetCustomerCountByTierId(tier.Id),
                    Name           = tier.Name,
                    Threshold      = tier.Threshold
                });
            }

            return(result);
        }
コード例 #2
0
 public Task <IReadOnlyList <Tier> > GetAllAsync()
 {
     return(_tiersRepository.GetAllAsync());
 }