The code is pretty simple. I am not actually executing the queries myself. That is being done by the
EntityQueryPagedCollectionView
var query = manager.AdmissionApplications
.Where(x => x.Review.Status.IsInitialStatus && x.IsSubmitted)
.OrderBy(x => x.SubmittedAt)
.Include(x => x.PersonalInformation)
.Include(x => x.PersonalInformation.Account)
.Include(x => x.Requirements)
.Include("Requirements.Requirement");
Applications = new EntityQueryPagedCollectionView(
(EntityQuery)query,
PageSize
);
var query2 = manager.Inquiries
.Where(x => x.IsSubmitted && x.Status == InquiryStatus.New)
.OrderBy(x => x.SubmittedAt)
.Include(x => x.PersonalInformation);
Inquiries = new EntityQueryPagedCollectionView(
(EntityQuery)query2,
PageSize
);
In this case, both Applications and Inquiries are instances of EntityQueryPagedCollectionView. This code causes the above error to occur. As far as I can tell, there is no way to set the UserState since I am not directly executing the queries. Is this a bug in the CollectionView or am I missing something entirely?