Class ColumnMap

This attribute defines the mapping between property names in the objects and column names in the database. By default, when reading or writing data from/into a database, properties in your objects are mapped to database columns with the same name (case-sensitive). Using this attribute, you can add your own mapping. (E.g. a property "Prop1" is mapped by default to the database column "Prop1". Create a column mapping to change the mapping to "Column1")

Inheritance
object
System.Attribute
ColumnMap
Implements
System.ICloneable
Inherited Members
System.Attribute.Equals(object)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, bool)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, bool)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, bool)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, bool)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, bool)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, bool)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, bool)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, bool)
System.Attribute.GetCustomAttributes(System.Reflection.Module)
System.Attribute.GetCustomAttributes(System.Reflection.Module, bool)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, bool)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, bool)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, bool)
System.Attribute.GetHashCode()
System.Attribute.IsDefaultAttribute()
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, bool)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, bool)
System.Attribute.IsDefined(System.Reflection.Module, System.Type)
System.Attribute.IsDefined(System.Reflection.Module, System.Type, bool)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, bool)
System.Attribute.Match(object)
System.Attribute.TypeId
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
    [AttributeUsage(AttributeTargets.Property)]
public sealed class ColumnMap : Attribute, ICloneable
Examples
 public class MyPoco
{
    [ColumnMap("Column1")]
    public string Prop1 { get; set; }
}

Constructors

ColumnMap()

Declaration
    public ColumnMap()
Examples
 public class MyPoco
{
    [ColumnMap("Column1")]
    public string Prop1 { get; set; }
}

ColumnMap(string)

Creates a mapping between the a property and a database column

Declaration
    public ColumnMap(string dbColumnName)
Parameters
TypeNameDescription
stringdbColumnName

The name of the column in the database

Properties

ArrayIndex

Index of the element in the array, only necessary if you use arrays as data type

Declaration
    public int? ArrayIndex { get; set; }
Property Value
TypeDescription
int?

DbColumnName

Name of the database column

Declaration
    public string DbColumnName { get; set; }
Property Value
TypeDescription
string

IgnoreColumn

If set to true, this property will be ignored and not mapped to any column.

Declaration
    public bool IgnoreColumn { get; set; }
Property Value
TypeDescription
bool

PropertyName

Name of the property that should be mapped to a database column

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

Methods

Clone()

Declaration
    public object Clone()
Returns
TypeDescription
object
Examples
 public class MyPoco
{
    [ColumnMap("Column1")]
    public string Prop1 { get; set; }
}

Implements

System.ICloneable