/// <summary> /// Gets the descendants of the <see cref="IProductCollection"/> including itself. /// </summary> /// <param name="value"> /// The value. /// </param> /// <param name="predicate"> /// The predicate. /// </param> /// <returns> /// The <see cref="IEnumerable{IProductCollection}"/>. /// </returns> public static IEnumerable <IProductCollection> DescendantsOrSelf(this IProductCollection value, Expression <Func <IProductCollection, bool> > predicate = null) { return(value.AsTreeNode().DescendantsOrSelf().Values(predicate)); }
/// <summary> /// Gets the siblings of the <see cref="IProductCollection"/>. /// </summary> /// <param name="value"> /// The value. /// </param> /// <param name="predicate"> /// An optional lambda expression /// </param> /// <returns> /// The <see cref="IEnumerable{IProductCollection}"/>. /// </returns> public static IEnumerable <IProductCollection> Ancestors(this IProductCollection value, Expression <Func <IProductCollection, bool> > predicate = null) { return(value.AsTreeNode().Ancestors().Values(predicate)); }
/// <summary> /// Gets the first descendant matching the expression /// </summary> /// <param name="value"> /// The value. /// </param> /// <param name="predicate"> /// The predicate. /// </param> /// <returns> /// The <see cref="IProductCollection"/>. /// </returns> public static IProductCollection Descendant(this IProductCollection value, Expression <Func <IProductCollection, bool> > predicate) { return(value.AsTreeNode().Descendants().Values(predicate).FirstOrDefault()); }