Beispiel #1
0
        public async Task RepositoryGroupsTo3Cities()
        {
            var result = await _repository.GetPersonAddressGroupedByCityAsync();

            //get the distinct list of cities from the whole data set.
            var cities = result.SelectMany(grp => grp.PersonAddressList.Select(list => list.City.ToUpperInvariant())).Distinct();

            Assert.IsNotNull(result);
            Assert.AreEqual(3, result.Count);
            Assert.AreEqual(3, cities.Count());
        }
        public async Task <IEnumerable <PersonAddressCityGroup> > Get()
        {
            var result = await _personAddressRepository.GetPersonAddressGroupedByCityAsync();

            return(result);
        }