Beispiel #1
0
        public List <UserType> GetOnlyUserAndAddressInfo(IEnumerable <long> userIds)
        {
            using (var myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                var linqMetaData = new LinqMetaData(myAdapter);

                var userEntities = linqMetaData.User.Where(u => userIds.Contains(u.UserId)).ToList();

                if (userEntities.IsEmpty())
                {
                    throw new EmptyCollectionException();
                }
                List <long> addressIds = userEntities.Select(ue => ue.HomeAddressId).ToList();
                return(_userFactory.CreateOnlyUsers(userEntities, _addressRepository.GetAddresses(addressIds)));
            }
        }