public List <Distributor> GetDistributors(string adminUsername) { var userRepository = distributorRepository as IUserRepository <User>; Guid useGuid = userRepository.GetUserByUsername(adminUsername).UserId; return(distributorRepository.GetMany(distributor => distributor.Parent == useGuid).ToList()); }