コード例 #1
0
        public async Task <IEnumerable <Automobile> > GetAutomobilesForCustomerAsync(int theCustomerId)
        {
            // get location ids for customer
            var aLocations = await _locationRepository.GetLocationsForCustomerAsync(theCustomerId);

            if (aLocations == null)
            {
                return(Enumerable.Empty <Automobile>());
            }

            // get automobiles for all customer locations
            return(await _autoRepository.GetAutomobilesForLocationsAsync(aLocations.Select(aItem => aItem.Id)));
        }