Class MemorySource<TOutput>
Define a source based on a generic .NET collection. This could be a List<T> or any other IEnumerable<T>. By default, an empty List<T> is created which can be filled with data.
Inherited Members
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
public class MemorySource<TOutput> : DataFlowExecutableSource<TOutput>, IDataFlowExecutableSource<TOutput>, IDataFlowSource<TOutput>, IDataFlowExecutableSource, IDataFlowSource, IDataFlowComponent, ILoggableTaskType Parameters
| Name | Description |
|---|---|
| TOutput | Type of outgoing data. |
Examples
MemorySource<MyRow> source = new MemorySource<MyRow>();
source.Data = new List<MyRow>()
{
new MyRow() { Id = 1, Value = "Test1" },
new MyRow() { Id = 2, Value = "Test2" },
new MyRow() { Id = 3, Value = "Test3" }
};Constructors
MemorySource()
Declaration
public MemorySource()MemorySource(IEnumerable<TOutput>)
Declaration
public MemorySource(IEnumerable<TOutput> data)Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<TOutput> | data | Set the source collection and stores it in Data |
Properties
Data
The .NET collection that is used to read the data from.
Declaration
public IEnumerable<TOutput> Data { get; set; }Property Value
| Type | Description |
|---|---|
| IEnumerable<TOutput> |
DataAsList
If the source collection implements IList<T> then this property will convert the collection into this interface type.
Declaration
public IList<TOutput> DataAsList { get; set; }Property Value
| Type | Description |
|---|---|
| IList<TOutput> |
Methods
CheckParameter()
Declaration
protected override void CheckParameter()Overrides
CleanUpOnFaulted(Exception)
Declaration
protected override void CleanUpOnFaulted(Exception e)Parameters
| Type | Name | Description |
|---|---|---|
| Exception | e |
Overrides
CleanUpOnSuccess()
Declaration
protected override void CleanUpOnSuccess()Overrides
OnExecutionDoAsyncWork()
Declaration
protected override void OnExecutionDoAsyncWork()Overrides
Reset()
Declaration
protected override void Reset()