London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Match PageData objects against PropertyCriteriaCollection

Vote:
 

Hi there

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 =)
/Henrik
#55973
Dec 22, 2011 21:27
Vote:
 

FilterCompareTo pretty much does the same thing.

#55975
Dec 23, 2011 9:46
Vote:
 

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.

#55982
Dec 23, 2011 17:19
Vote:
 

Yes, I was just thinking out loud that FilterCompareTo would be a good match but you had obviously already considered that.

#56064
Jan 03, 2012 10:47
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.