FindPagesWithCriteria on parent Type

Vote:
 

Hello,

I have the following structure:

class BasePage : PageData {}

class A : BasePage {}

class B : BasePage {}

and some other classes who inherit from this BasePage.

Now I need to retreive all the pages based on the BasePage type how can I do that except by queriing the tree recursively?

I have try

var collection = new PropertyCriteriaCollection
{
new PropertyCriteria
{
Required = true,
Name = "PageTypeName",
Condition = CompareCondition.Equal,
Type = PropertyDataType.PageType,
Value = "BasePage"
}
};

var queryService = ServiceLocator.Current.GetInstance<IPageCriteriaQueryService>();


return queryService.FindPagesWithCriteria(ContentReference.RootPage, collection);

 

But it doesn't seem to work.

 

Regards,

Benjamin

 

#80184
Jan 16, 2014 10:38
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.