Table of Contents

TraverseWhileNotEmpty Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Core.dll
Source
src/Cuemon.Core/Extensions/ObjectDecoratorExtensions.cs

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

decorator IDecorator<TSource>

The IDecorator<T> to extend.

traversal Func<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- traversal is null.