Class OrderAttribute
An attribute to place on dataflow row columns (i.e. fields and properties), to control the order of columns for certain column order and mapping facilities, using an ordering index:
OrderAttribute
with index: The index is explicitly provided. It must be
in the range:
[0, 9999], [20000,29999], [40000,49999], or [60000,69999].
OrderAttribute
without index: The member will automatically get an
index and be ordered on the declaration order in the source file.
This allows managing the order by simply moving the members around in the row class.
Base class members will come before derived class members, and for any
partial
classes, the members are first sorted on the filename from
CallerFilePathAttribute. By default
they will get an index in the range [10000,19999], or in the range [50000,59999]
if setting afterAlphabetical
= true
.
No OrderAttribute
: These members will automatically get an index
in the [30000,39999] range, in member name (ordinal case sensitive)
alphabetical order.
You can use GetFieldsAndPropertiesInOrder(Type, BindingFlags) to retrieve this ordering without column schema columns, when e.g. implementing custom workers.
You can also use TypeRowSchema to retrieve this ordering with
column schema columns. The columns in a column schema are kept together as a group,
are ordered according to the OrderAttribute
rules within the group, with
the whole group placed in the overall order where their parent member is placed
(i.e. change the position of the whole group by changing the position of the
parent member).
Implements
Inherited Members
Namespace: actionETL
Assembly: actionETL.dll
Syntax
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
public sealed class OrderAttribute : Attribute, IComparable<OrderAttribute>
Constructors
OrderAttribute(Boolean, String, Int32)
Automatically set the column ordering index based on the declaration order of members in the source code file. This allows managing the column order by simply moving the members around in the row class.
A base class members will come before derived class members, and for any
partial
classes, the members are first sorted on the filename from
CallerFilePathAttribute.
Declaration
public OrderAttribute(bool afterAlphabetical, string callerFilePath = "", int callerLineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
Boolean | afterAlphabetical | If set to
If set to |
String | callerFilePath | The caller file path. For internal use. |
Int32 | callerLineNumber | The caller line number. For internal use. |
OrderAttribute(Int32)
Set column order based on the specified ordering index.
Declaration
public OrderAttribute(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The ordering index. Must be in the range [0, 9999], [20000,29999], [40000,49999], or [60000,69999]. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
OrderAttribute(String, Int32)
Automatically set the column ordering index based on the declaration order of members in the source code file. This allows managing the column order by simply moving the members around in the row class.
A base class members will come before derived class members, and for any
partial
classes, the members are first sorted on the filename from
CallerFilePathAttribute. The member will get an
index in the range [10000,19999], placing it before alphabetically sorted members.
Declaration
public OrderAttribute(string callerFilePath = "", int callerLineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
String | callerFilePath | The caller file path. For internal use. |
Int32 | callerLineNumber | The caller line number. For internal use. |
Properties
Order
Gets the order string that is used for (case sensitive ordinal) ordering columns.
Declaration
public string Order { get; }
Property Value
Type | Description |
---|---|
String |
Methods
CompareTo(OrderAttribute)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the case sensitive ordinal sort order versus the other object.
Declaration
public int CompareTo(OrderAttribute other)
Parameters
Type | Name | Description |
---|---|---|
OrderAttribute | other | An object to compare with this instance. |
Returns
Type | Description |
---|---|
Int32 | A value that indicates the relative order of the objects being compared:
Less than zero: This instance precedes
Zero: This instance occurs in the same position in the sort order as
Greater than zero: This instance follows |
Equals(Object)
Determines whether the specified Object, is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The Object to compare with this instance. |
Returns
Type | Description |
---|---|
Boolean |
|
Overrides
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
Operators
Equality(OrderAttribute, OrderAttribute)
Implements the operator ==.
Declaration
public static bool operator ==(OrderAttribute left, OrderAttribute right)
Parameters
Type | Name | Description |
---|---|---|
OrderAttribute | left | The left. |
OrderAttribute | right | The right. |
Returns
Type | Description |
---|---|
Boolean | The result of the operator. |
GreaterThan(OrderAttribute, OrderAttribute)
Implements the operator >.
Declaration
public static bool operator>(OrderAttribute left, OrderAttribute right)
Parameters
Type | Name | Description |
---|---|---|
OrderAttribute | left | The left. |
OrderAttribute | right | The right. |
Returns
Type | Description |
---|---|
Boolean | The result of the operator. |
GreaterThanOrEqual(OrderAttribute, OrderAttribute)
Implements the operator >=.
Declaration
public static bool operator >=(OrderAttribute left, OrderAttribute right)
Parameters
Type | Name | Description |
---|---|---|
OrderAttribute | left | The left. |
OrderAttribute | right | The right. |
Returns
Type | Description |
---|---|
Boolean | The result of the operator. |
Inequality(OrderAttribute, OrderAttribute)
Implements the operator !=.
Declaration
public static bool operator !=(OrderAttribute left, OrderAttribute right)
Parameters
Type | Name | Description |
---|---|---|
OrderAttribute | left | The left. |
OrderAttribute | right | The right. |
Returns
Type | Description |
---|---|
Boolean | The result of the operator. |
LessThan(OrderAttribute, OrderAttribute)
Implements the operator <.
Declaration
public static bool operator <(OrderAttribute left, OrderAttribute right)
Parameters
Type | Name | Description |
---|---|---|
OrderAttribute | left | The left. |
OrderAttribute | right | The right. |
Returns
Type | Description |
---|---|
Boolean | The result of the operator. |
LessThanOrEqual(OrderAttribute, OrderAttribute)
Implements the operator <=.
Declaration
public static bool operator <=(OrderAttribute left, OrderAttribute right)
Parameters
Type | Name | Description |
---|---|---|
OrderAttribute | left | The left. |
OrderAttribute | right | The right. |
Returns
Type | Description |
---|---|
Boolean | The result of the operator. |