TraverseWhileNotNull Method
Definition
- Namespace
- Cuemon.Extensions.Runtime
- Assemblies
- Cuemon.Extensions.Core.dll
TraverseWhileNotNull<TSource>(TSource, Func<TSource, TSource>)
Invokes the specified traversal path of source until obstructed by a null value.
public static IEnumerable<TSource> TraverseWhileNotNull<TSource>(TSource source, Func<TSource, TSource> traversal) where TSource : class
Parameters
sourceTSourceThe source to travel until the
traversalpath is obstructed by a null value.traversalFunc<TSource, TSource>The function delegate that is invoked until the traveled path is obstructed by a null value.
Returns
- IEnumerable<TSource>
An IEnumerable<T> sequence equal to the traveled path of
source.
Type Parameters
TSourceThe type of the
source.
Exceptions
- ArgumentNullException
source-or-traversalis null.