Hello,
I searched all over the forums for clues to this question but couldn’t find anything that applies directly.
I am using 2.0 adapter model.
What is the best way to fetch a typed list, and then filter it in a variety of ways without going back to the database each time?
Here’s what I am trying to do:
CommunitiesNavTypedList navMenu = new CommunitiesNavTypedList();
DataAccessAdapter adapter = new DataAccessAdapter();
IRelationPredicateBucket bucket = navMenu.GetRelationInfo();
bucket.PredicateExpression.Add(CommunitiesFields.DisplayLevel >= 0);
bucket.PredicateExpression.Add(CommunitiesFields.DisplayLevel < 2);
adapter.FetchTypedList(navMenu.GetFieldsInfo(), navMenu, bucket, 0, null, true);
.
.
.
bucket.PredicateExpression.Clear(); <== This call does not exist
bucket.PredicateExpression.Add(CommunitiesFields.DisplayLevel == 0);
bucket.ApplyPredicate(); <== This call does not exist
foreach (CommunitiesNavRow communityRow in communities)
{
Debug.Print(communityRow.Name);
}
How do I clear the current filter and then apply a new one without calling the database?
Thank you in advance.
Rick