Search Results for

    Show / Hide Table of Contents

    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).

    Inheritance
    Object
    Attribute
    OrderAttribute
    Implements
    IComparable<OrderAttribute>
    Inherited Members
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, Boolean)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, Boolean)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, Boolean)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, Boolean)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, Boolean)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, Boolean)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, Boolean)
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, Boolean)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, Boolean)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module, Type, Boolean)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, Boolean)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, Boolean)
    Attribute.IsDefaultAttribute()
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, Boolean)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, Boolean)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, Boolean)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, Boolean)
    Attribute.Match(Object)
    Attribute.TypeId
    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 true, the member will get an index in the [50000,59999] range, placing it after members sorted alphabetically.

    If set to false, the member will get an index in the [10000,19999] range, placing it before members sorted alphabetically.

    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

    index - Must be in the range [0, 9999], [20000,29999], [40000,49999], or [60000,69999].

    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 other in the sort order.

    Zero: This instance occurs in the same position in the sort order as other.

    Greater than zero: This instance follows other in the sort order.

    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

    true if the specified Object is equal to this instance; otherwise, false.

    Overrides
    Attribute.Equals(Object)

    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
    Attribute.GetHashCode()

    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.

    Implements

    System.IComparable<T>

    See Also

    GetFieldsAndPropertiesInOrder(Type, BindingFlags)
    TypeRowSchema
    XlsxSource<TOutput>
    XlsxTargetFactory
    In This Article
    Back to top Copyright © 2023 Envobi Ltd