Is there any other way to write this query? I am trying to page through users, grabbing their related data with the PathEdge, but I am getting an exception too many Parameters. PersonRepository.GetAllPersons() is just returning LinqMetaData.Persons. Thanks!
I need to grab all the navigation data, so I am not generating 1000's of SQL calls in the processing loop.
I am referencing assemblies SD.LLBLGEN.Pro.LinqSupportClasses.NET35, SD.LLBLGEN.ORMSupportClasses.NET20
int totalCount = PersonRepository.GetAllPersons().Count(x => x.PrimaryCustomerGuid == CustomerGuid);
int pageSize = 5000;
int page = 1;
int totalPages = totalCount / pageSize;
while (page < totalPages)
{
var persons = PersonRepository.GetAllPersons()
.WithPath(
new PathEdge<PersonEntity>(PersonEntity.PrefetchPathPersonRoles),
new PathEdge<PersonEntity>(PersonEntity.PrefetchPathPersonBusinessUnits),
new PathEdge<PersonEntity>(PersonEntity.PrefetchPathPersonMetaDatas),
new PathEdge<PersonEntity>(PersonEntity.PrefetchPathPersonChildCustomers))
.Where(p => p.PrimaryCustomerGuid == CustomerGuid)
.OrderBy(p => p.Email)
.TakePage(page, pageSize)
.ToList();
foreach (var person in persons)
{
pipeline.Execute(person.BusinessUnitRequest());
}
page++;
}