Class CustomSource<TOutput>

Define your own source block. This block generates data from a your own custom written functions.

Inheritance
System.Object
CustomSource<TOutput>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ETLBox.DataFlow.Connectors
Assembly: ETLBox.dll
Syntax
    public class CustomSource<TOutput> : DataFlowExecutableSource<TOutput>, ILoggableTask, IDataFlowLogging, IDataFlowExecutableSource<TOutput>, IDataFlowSource<TOutput>, IDataFlowSource, IDataFlowComponent, IDataFlowExecutableSource
Type Parameters
NameDescription
TOutput

Type of outgoing data.

Examples
 List<string> Data = new List<string>()
 {
     "Test1", "Test2", "Test3"
 };
 var source = new CustomSource<MyRow>();
 source.ReadFunc = progressCount =>
 {
     return new MyRow()
     {
         Id = progressCount + 1,
         Value = Data[progressCount]
     };    
    return result;
 };
source.ReadCompletedFunc =  progressCount => progressCount >= Data.Count;

Constructors

CustomSource()

Declaration
    public CustomSource()

CustomSource(Func<Int32, TOutput>, Predicate<Int32>)

Declaration
    public CustomSource(Func<int, TOutput> readFunc, Predicate<int> readingCompleted)
Parameters
TypeNameDescription
System.Func<System.Int32, TOutput>readFunc

Sets the ReadFunc

System.Predicate<System.Int32>readingCompleted

Sets the ReadingCompleted

Properties

ReadFunc

The function that returns a data row as output. An integer value with the current progress count is the input of the function.

Declaration
    public Func<int, TOutput> ReadFunc { get; set; }
Property Value
TypeDescription
System.Func<System.Int32, TOutput>

ReadingCompleted

This predicate returns true when all rows for the flow are successfully returned from the ReadFunc. An integer value with the current progress count is the input of the predicate.

Declaration
    public Predicate<int> ReadingCompleted { get; set; }
Property Value
TypeDescription
System.Predicate<System.Int32>

TaskName

A name to identify the task or component. Every component or task comes with a default name that can be overwritten.

Declaration
    public override string TaskName { get; set; }
Property Value
TypeDescription
System.String
Overrides

Methods

CheckParameter()

Declaration
    protected override void CheckParameter()
Overrides

CleanUpOnFaulted(Exception)

Declaration
    protected override void CleanUpOnFaulted(Exception e)
Parameters
TypeNameDescription
System.Exceptione
Overrides

CleanUpOnSuccess()

Declaration
    protected override void CleanUpOnSuccess()
Overrides

OnExecutionDoAsyncWork()

Declaration
    protected override void OnExecutionDoAsyncWork()
Overrides
ETLBox.DataFlow.DataFlowExecutableSource<TOutput>.OnExecutionDoAsyncWork()

OnExecutionDoSynchronousWork()

Declaration
    protected override void OnExecutionDoSynchronousWork()
Overrides
ETLBox.DataFlow.DataFlowExecutableSource<TOutput>.OnExecutionDoSynchronousWork()

Implements