Class ExcelColumn

This attribute defines either which column index is mapped to the property or the header name that identifies the column By default, when reading from an excel file, a header column is expected in the first row. The name of the header is used to match with the property names of the object. With this attribute, you can define the column index of the excel column for the property or a different header name for a property. The index starts at 0.

Inheritance
System.Object
System.Attribute
ExcelColumn
Inherited Members
System.Attribute.Equals(System.Object)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetHashCode()
System.Attribute.IsDefaultAttribute()
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Module, System.Type)
System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.Match(System.Object)
System.Attribute.TypeId
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ETLBox.DataFlow
Assembly: ETLBox.Excel.dll
Syntax
    [AttributeUsage(AttributeTargets.Property)]
public class ExcelColumn : Attribute
Examples

public class MyPoco { [ExcelColumn("HeaderName")] public string ColumnByHeaderName { get; set; } [ExcelColumn(2)] public string ThirdColumnInExcel { get; set; } }

Constructors

ExcelColumn()

Declaration
    public ExcelColumn()

ExcelColumn(Int32)

Declaration
    public ExcelColumn(int columnIndex)
Parameters
TypeNameDescription
System.Int32columnIndex

ExcelColumn(Int32, String)

Declaration
    public ExcelColumn(int columnIndex, string columnName)
Parameters
TypeNameDescription
System.Int32columnIndex
System.StringcolumnName

ExcelColumn(String)

Declaration
    public ExcelColumn(string columnName)
Parameters
TypeNameDescription
System.StringcolumnName

Properties

ColumnIndex

Declaration
    public int? ColumnIndex { get; set; }
Property Value
TypeDescription
System.Nullable<System.Int32>

ColumnName

Declaration
    public string ColumnName { get; set; }
Property Value
TypeDescription
System.String

PropertyName

Declaration
    public string PropertyName { get; set; }
Property Value
TypeDescription
System.String