Class ColumnRename<TInput>
ColumnRename allows you to rename the column or properties names of your ingoing data.
This transformation works with objects, ExpandoObjects and arrays as input data type.
ColumnRename will always convert the input type into a (dynamic) ExpandoObject.
Provide a column mapping with the old and the new name. The mapping can also be automatically retrieved from
existing ColumnMap attributes. For arrays provide the array index and the new name.
Inheritance
ColumnRename<TInput>
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
public class ColumnRename<TInput> : DataFlowTransformation<TInput, ExpandoObject>, IDataFlowLogging, IDataFlowTransformation<TInput, ExpandoObject>, IDataFlowSource<ExpandoObject>, IDataFlowSource, IDataFlowDestination<TInput>, IDataFlowDestination, IDataFlowComponent, ILoggableTask
Type Parameters
Name | Description |
---|
TInput | Type of ingoing data |
Constructors
ColumnRename()
Declaration
ColumnRename(ICollection<RenameColumn>)
Declaration
public ColumnRename(ICollection<RenameColumn> renameColumns)
Parameters
Properties
ProgressCount
Declaration
public int ProgressCount { get; }
Property Value
RenameColumns
The column mapping defines how existing properties or columns are renamed.
For objects and dynamic object provide a mapping with the old and the new name (arrays: array index and new name).
The mapping can also be automatically retrieved from RenameColumn attributes on the properties in strongly typed objects.
Declaration
public ICollection<RenameColumn> RenameColumns { get; set; }
Property Value
RenameFunc
Instead (or additional) to existing column renaming provided via the RenameColumns property or
the RenameColumn attribute, you can define your own renaming function.
It is called for each column in each row from the input, and allows you to transform the column/property name into
a different property name.
Declaration
public Func<string, string> RenameFunc { get; set; }
Property Value
SourceBlock
SourceBlock from the underlying TPL.Dataflow which is used as output buffer for the component.
Declaration
public override ISourceBlock<ExpandoObject> SourceBlock { get; }
Property Value
Overrides
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
Overrides
Methods
CheckParameter()
Declaration
protected override void CheckParameter()
Overrides
CleanUpOnFaulted(Exception)
Declaration
protected override void CleanUpOnFaulted(Exception e)
Parameters
Overrides
CleanUpOnSuccess()
Declaration
protected override void CleanUpOnSuccess()
Overrides
InitComponent()
Declaration
protected override void InitComponent()
Overrides
LinkErrorTo(IDataFlowDestination<ETLBoxError>)
If an error occurs in the component, by default the component will throw an exception and stop execution.
If you use the error linking, any erroneous records will be caught and redirected.
Declaration
public override IDataFlowSource<ETLBoxError> LinkErrorTo(IDataFlowDestination<ETLBoxError> target)
Parameters
Returns
Overrides
PrepareParameterForCheck()
Declaration
protected override void PrepareParameterForCheck()
Overrides
Reset()
Declaration
protected override void Reset()
Overrides
Implements