I'm looking for a way to check if an already retrieved PageData object represents a page that fulfills the criteria in a PropertyCriteriaCollection. Either that or to check if it fulfills a single criterion. Is there anyone who knows if there's an easy way to do this, or will I have to get my hands dirty?
In other words, I'm looking to do this:
bool matches = myPageData.Fulfills(myPropertyCriteriaCollection);
Any tips are appreciated =)
FilterCompareTo pretty much does the same thing.
Thanks for your reply Per, but I don't understand what you mean. How can I use use FilterComparedTo to emulate the filtering performed by the DataFactory when searching for pages using a PropertyCriteriaCollection? There seems to be a fairly good match between the concepts in a PropertyCriteria criterion and the properties of the FilterCompareTo class, but the filter has no concept of combining multiple criteria or even consider the IsNull/Required properties of the PropertyCriteria class.
If I decide to go and implement the filter myself, the FilterCompareTo is probably what I would use to accomplish that but I'm gonna wait a little bit more to see if anyone knows of a good way to do this.
Yes, I was just thinking out loud that FilterCompareTo would be a good match but you had obviously already considered that.