Wednesday, July 20, 2016
Wednesday, July 6, 2016
Find Pages With Criteria of type T Example Episerver 7,8,9
private IEnumerable<T> FindPagesByPageTypeRecursively<T>() where T : IContent
{
var criteria = new PropertyCriteriaCollection
{
new PropertyCriteria
{
Name = "PageTypeID", Type = PropertyDataType.PageType, Value = typeof(T).GetPageTypeId().ToString(), Required = true
}
};
IEnumerable<T> descendants = DataFactory.Instance.FindPagesWithCriteria(PageReference.RootPage,
criteria).Cast<T>();
return descendants;
}
Subscribe to:
Posts (Atom)

