Title here
Summary here
Define your own source block. This block generates data from a your own custom written functions.
public class CustomSource<TOutput> : DataFlowExecutableSource<TOutput>, IDataFlowLogging, IDataFlowExecutableSource<TOutput>, IDataFlowSource<TOutput>, IDataFlowExecutableSource, IDataFlowSource, IDataFlowComponent, ILoggableTask
Name | Description |
---|---|
TOutput | Type of outgoing data. |
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;
public CustomSource()
public CustomSource(Func<int, TOutput> readFunc, Predicate<int> readingCompleted)
Type | Name | Description |
---|---|---|
Func<int, TOutput> | readFunc | Sets the ReadFunc |
Predicate<int> | readingCompleted | Sets the ReadingCompleted |
The function that returns a data row as output. An integer value with the current progress count is the input of the function.
public Func<int, TOutput> ReadFunc { get; set; }
Type | Description |
---|---|
Func<int, TOutput> |
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.
public Predicate<int> ReadingCompleted { get; set; }
Type | Description |
---|---|
Predicate<int> |
protected override void CheckParameter()
protected override void CleanUpOnFaulted(Exception e)
Type | Name | Description |
---|---|---|
Exception | e |
protected override void CleanUpOnSuccess()
protected override void OnExecutionDoAsyncWork()