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); }
public Task <IReadOnlyList <Tier> > GetAllAsync() { return(_tiersRepository.GetAllAsync()); }