Class NetworkHelper

Replaces sources, destinations and error destinations in an already linked network with real test components such as MemorySource<TOutput>, MemoryDestination<TInput>, CustomSource<TOutput> or CustomDestination<TInput>.

Inheritance
NetworkHelper
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
    public static class NetworkHelper
Remarks

The caller selects the node. A replacement must be a real DataFlowComponent.

Methods

GetDestinations(IDataFlowComponent)

Destinations in the main flow. Auto-generated void destinations and error destinations are excluded.

Declaration
    public static IReadOnlyList<IDataFlowDestination> GetDestinations(IDataFlowComponent startNode)
Parameters
TypeNameDescription
IDataFlowComponentstartNode
Returns
TypeDescription
IReadOnlyList<IDataFlowDestination>

GetErrorDestinations(IDataFlowComponent)

Declaration
    public static IReadOnlyList<IDataFlowDestination<ETLBoxError>> GetErrorDestinations(IDataFlowComponent startNode)
Parameters
TypeNameDescription
IDataFlowComponentstartNode
Returns
TypeDescription
IReadOnlyList<IDataFlowDestination<ETLBoxError>>

GetSources(IDataFlowComponent)

Executable sources in the network. ErrorSource is excluded.

Declaration
    public static IReadOnlyList<IDataFlowExecutableSource> GetSources(IDataFlowComponent startNode)
Parameters
TypeNameDescription
IDataFlowComponentstartNode
Returns
TypeDescription
IReadOnlyList<IDataFlowExecutableSource>

ReplaceDestination<TReplacement>(IDataFlowComponent, Func<IDataFlowDestination, bool>, TReplacement)

Replaces the single main-flow destination for which match returns true.

Declaration
    public static TReplacement ReplaceDestination<TReplacement>(IDataFlowComponent startNode, Func<IDataFlowDestination, bool> match, TReplacement replacement) where TReplacement : DataFlowComponent, IDataFlowDestination
Parameters
TypeNameDescription
IDataFlowComponentstartNode
Func<IDataFlowDestination, bool>match
TReplacementreplacement
Returns
TypeDescription
TReplacement
Type Parameters
NameDescription
TReplacement

ReplaceDestination<TReplacement>(IDataFlowComponent, Func<IReadOnlyList<IDataFlowDestination>, IDataFlowDestination>, TReplacement)

Replaces one destination in the main flow. The selector must return one of the offered destinations.

Declaration
    public static TReplacement ReplaceDestination<TReplacement>(IDataFlowComponent startNode, Func<IReadOnlyList<IDataFlowDestination>, IDataFlowDestination> select, TReplacement replacement) where TReplacement : DataFlowComponent, IDataFlowDestination
Parameters
TypeNameDescription
IDataFlowComponentstartNode
Func<IReadOnlyList<IDataFlowDestination>, IDataFlowDestination>select
TReplacementreplacement
Returns
TypeDescription
TReplacement
Type Parameters
NameDescription
TReplacement

ReplaceErrorDestination<TReplacement>(IDataFlowComponent, Func<IDataFlowDestination<ETLBoxError>, bool>, TReplacement)

Replaces the single error destination for which match returns true.

Declaration
    public static TReplacement ReplaceErrorDestination<TReplacement>(IDataFlowComponent startNode, Func<IDataFlowDestination<ETLBoxError>, bool> match, TReplacement replacement) where TReplacement : DataFlowComponent, IDataFlowDestination<ETLBoxError>
Parameters
TypeNameDescription
IDataFlowComponentstartNode
Func<IDataFlowDestination<ETLBoxError>, bool>match
TReplacementreplacement
Returns
TypeDescription
TReplacement
Type Parameters
NameDescription
TReplacement

ReplaceErrorDestination<TReplacement>(IDataFlowComponent, Func<IReadOnlyList<IDataFlowDestination<ETLBoxError>>, IDataFlowDestination<ETLBoxError>>, TReplacement)

Replaces one error destination. The selector must return one of the offered error destinations.

Declaration
    public static TReplacement ReplaceErrorDestination<TReplacement>(IDataFlowComponent startNode, Func<IReadOnlyList<IDataFlowDestination<ETLBoxError>>, IDataFlowDestination<ETLBoxError>> select, TReplacement replacement) where TReplacement : DataFlowComponent, IDataFlowDestination<ETLBoxError>
Parameters
TypeNameDescription
IDataFlowComponentstartNode
Func<IReadOnlyList<IDataFlowDestination<ETLBoxError>>, IDataFlowDestination<ETLBoxError>>select
TReplacementreplacement
Returns
TypeDescription
TReplacement
Type Parameters
NameDescription
TReplacement

ReplaceSource<TReplacement>(IDataFlowComponent, Func<IDataFlowExecutableSource, bool>, TReplacement)

Replaces the single source for which match returns true.

Declaration
    public static TReplacement ReplaceSource<TReplacement>(IDataFlowComponent startNode, Func<IDataFlowExecutableSource, bool> match, TReplacement replacement) where TReplacement : DataFlowComponent, IDataFlowSource
Parameters
TypeNameDescription
IDataFlowComponentstartNode
Func<IDataFlowExecutableSource, bool>match
TReplacementreplacement
Returns
TypeDescription
TReplacement
Type Parameters
NameDescription
TReplacement

ReplaceSource<TReplacement>(IDataFlowComponent, Func<IReadOnlyList<IDataFlowExecutableSource>, IDataFlowExecutableSource>, TReplacement)

Replaces the source selected by select. The selector receives every source and must return exactly one of them.

Declaration
    public static TReplacement ReplaceSource<TReplacement>(IDataFlowComponent startNode, Func<IReadOnlyList<IDataFlowExecutableSource>, IDataFlowExecutableSource> select, TReplacement replacement) where TReplacement : DataFlowComponent, IDataFlowSource
Parameters
TypeNameDescription
IDataFlowComponentstartNode
Func<IReadOnlyList<IDataFlowExecutableSource>, IDataFlowExecutableSource>select
TReplacementreplacement
Returns
TypeDescription
TReplacement
Type Parameters
NameDescription
TReplacement