TraverseWhileNotEmpty Method
Definition
- Namespace
- Cuemon
- Assemblies
- Cuemon.Core.dll
TraverseWhileNotEmpty<TSource>(IDecorator<TSource>, Func<TSource, IEnumerable<TSource>>)
Invokes the specified traversal path of the enclosed object of the specified decorator until obstructed by an empty sequence.
public static IEnumerable<TSource> TraverseWhileNotEmpty<TSource>(this IDecorator<TSource> decorator, Func<TSource, IEnumerable<TSource>> traversal) where TSource : class
Parameters
decoratorIDecorator<TSource>The IDecorator<T> to extend.
traversalFunc<TSource, IEnumerable<TSource>>The function delegate that is invoked until the traveled path is obstructed by an empty sequence.
Returns
- IEnumerable<TSource>
An IEnumerable<T> sequence equal to the traveled path of the enclosed object of the specified
decorator.
Type Parameters
TSource
Exceptions
- ArgumentNullException
decorator-or-traversalis null.