ColumnTransformation<TInput>
Class ColumnTransformation<TInput>
Allows you to rename, remove or reorders the columns/properties of your ingoing data.
This transformation works with objects and dynamic ExpandoObjects as input data type.
It will always convert the input type into an ExpandoObject as output.
Inherited Members
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
public class ColumnTransformation<TInput> : DataFlowTransformation<TInput, ExpandoObject>, IDataFlowTransformation<TInput, ExpandoObject>, IDataFlowSource<ExpandoObject>, IDataFlowSource, IDataFlowDestination<TInput>, IDataFlowDestination, IDataFlowComponent, ILoggableTask
Type Parameters
Name | Description |
---|---|
TInput | Type of ingoing data |
Constructors
ColumnTransformation()
Declaration
public ColumnTransformation()
Properties
ProgressCount
Declaration
public int ProgressCount { get; }
Property Value
Type | Description |
---|---|
int |
RemoveColumns
The remove columns defines if an existing property/column should be removed from the output object.
Declaration
public ICollection<RemoveColumn> RemoveColumns { get; set; }
Property Value
Type | Description |
---|---|
ICollection<RemoveColumn> |
RemoveFunc
Instead (or additional) to existing column removing provided via the RemoveColumns property or the RemoveColumn attribute, you can define your own function to decide if a property should be removed.
Declaration
public Func<string, bool> RemoveFunc { get; set; }
Property Value
Type | Description |
---|---|
Func<string, bool> |
RenameColumns
The rename columns defines how existing properties/columns are renamed. For objects and dynamic object provide a mapping with the old and the 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
Type | Description |
---|---|
ICollection<RenameColumn> |
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
Type | Description |
---|---|
Func<string, string> |
ReorderColumns
The reorder columns defines how existing properties/columns are ordered when creating the output object.
Declaration
public ICollection<ReorderColumn> ReorderColumns { get; set; }
Property Value
Type | Description |
---|---|
ICollection<ReorderColumn> |
ReorderFunc
Instead (or additional) to existing column reordering provided via the ReorderColumns property or the ReorderColumn attribute, you can define your own function to set the new index of a property.
Declaration
public Func<string, object> ReorderFunc { get; set; }
Property Value
Type | Description |
---|---|
Func<string, object> |
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
Type | Description |
---|---|
ISourceBlock<ExpandoObject> |
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
Type | Description |
---|---|
ITargetBlock<TInput> |
Overrides
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
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
Type | Name | Description |
---|---|---|
IDataFlowDestination<ETLBoxError> | target | The target for erroneous rows. |
Returns
Type | Description |
---|---|
IDataFlowSource<ETLBoxError> | The linked component. |
Overrides
PrepareParameterForCheck()
Declaration
protected override void PrepareParameterForCheck()
Overrides
Reset()
Declaration
protected override void Reset()