Class RowDuplication<TInput>

Creates one or more duplicates of your incoming row. Use the CanDuplicate property if you want to duplicate only particular rows.

Inheritance
object
DataFlowTransformation<TInput, TInput>
RowDuplication<TInput>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
    public class RowDuplication<TInput> : DataFlowTransformation<TInput, TInput>, IDataFlowLogging, ILoggableTask, IDataFlowTransformation<TInput, TInput>, IDataFlowSource<TInput>, IDataFlowSource, IDataFlowDestination<TInput>, IDataFlowDestination, IDataFlowComponent
Type Parameters
NameDescription
TInput

Type of ingoing data.

Examples
var source = new DbSource<InputType>("SourceTable");
RowDuplication<InputType> duplication = new RowDuplication<InputType>(3);
var dest = new CsvDestination<InputType>("output.csv");
source.LinkTo(duplication).LinkTo(dest);

Constructors

RowDuplication()

Declaration
    public RowDuplication()
Examples
var source = new DbSource<InputType>("SourceTable");
RowDuplication<InputType> duplication = new RowDuplication<InputType>(3);
var dest = new CsvDestination<InputType>("output.csv");
source.LinkTo(duplication).LinkTo(dest);

RowDuplication(int)

Declaration
    public RowDuplication(int numberOfDuplicates)
Parameters
TypeNameDescription
intnumberOfDuplicates

Sets the NumberOfDuplicates

RowDuplication(Predicate<TInput>, int)

Declaration
    public RowDuplication(Predicate<TInput> canDuplicate, int numberOfDuplicates)
Parameters
TypeNameDescription
System.Predicate<T><TInput>canDuplicate

Sets the CanDuplicate predicate

intnumberOfDuplicates

Sets the NumberOfDuplicates

RowDuplication(Predicate<TInput>)

Declaration
    public RowDuplication(Predicate<TInput> canDuplicate)
Parameters
TypeNameDescription
System.Predicate<T><TInput>canDuplicate

Sets the CanDuplicate predicate

Properties

CanDuplicate

A predicate that describe if a will be duplicated or not.

Declaration
    public Predicate<TInput> CanDuplicate { get; set; }
Property Value
TypeDescription
System.Predicate<T><TInput>

NumberOfDuplicates

Number of duplicates to be created for each ingoing row. Default is 1 (meaning the incoming row plus one copy).

Declaration
    public int NumberOfDuplicates { get; set; }
Property Value
TypeDescription
int

SourceBlock

SourceBlock from the underlying TPL.Dataflow which is used as output buffer for the component.

Declaration
    public override ISourceBlock<TInput> SourceBlock { get; }
Property Value
TypeDescription
ISourceBlock<><TInput>
Overrides
ETLBox.DataFlow.DataFlowSource<TInput>.SourceBlock

TargetBlock

TargetBlock from the underlying TPL.Dataflow which is used as input buffer for the component.

Declaration
    public override ITargetBlock<TInput> TargetBlock { get; }
Property Value
TypeDescription
ITargetBlock<><TInput>
Overrides
ETLBox.DataFlow.DataFlowTransformation<TInput, TInput>.TargetBlock

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
string
Overrides

Methods

CheckParameter()

Declaration
    protected override void CheckParameter()
Overrides
Examples
var source = new DbSource<InputType>("SourceTable");
RowDuplication<InputType> duplication = new RowDuplication<InputType>(3);
var dest = new CsvDestination<InputType>("output.csv");
source.LinkTo(duplication).LinkTo(dest);

CleanUpOnFaulted(Exception)

Declaration
    protected override void CleanUpOnFaulted(Exception e)
Parameters
TypeNameDescription
System.Exceptione
Overrides
Examples
var source = new DbSource<InputType>("SourceTable");
RowDuplication<InputType> duplication = new RowDuplication<InputType>(3);
var dest = new CsvDestination<InputType>("output.csv");
source.LinkTo(duplication).LinkTo(dest);

CleanUpOnSuccess()

Declaration
    protected override void CleanUpOnSuccess()
Overrides
Examples
var source = new DbSource<InputType>("SourceTable");
RowDuplication<InputType> duplication = new RowDuplication<InputType>(3);
var dest = new CsvDestination<InputType>("output.csv");
source.LinkTo(duplication).LinkTo(dest);

InitComponent()

Declaration
    protected override void InitComponent()
Overrides
Examples
var source = new DbSource<InputType>("SourceTable");
RowDuplication<InputType> duplication = new RowDuplication<InputType>(3);
var dest = new CsvDestination<InputType>("output.csv");
source.LinkTo(duplication).LinkTo(dest);

Implements