Class DbColumnMap
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
DbColumnMap
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
Assembly: ETLBox.dll
Syntax
[AttributeUsage(AttributeTargets.Property)]
public sealed class DbColumnMap : Attribute, ICloneable
Examples
public class MyPoco
{
[DbColumnMap("Column1")]
public string Prop1 { get; set; }
}
Constructors
DbColumnMap()
Declaration
Examples
public class MyPoco
{
[DbColumnMap("Column1")]
public string Prop1 { get; set; }
}
DbColumnMap(string)
Creates a mapping between the a property and a database column
Declaration
public DbColumnMap(string dbColumnName)
Parameters
Type | Name | Description |
---|
string | dbColumnName | 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
DbColumnName
Name of the database column
Declaration
public string DbColumnName { get; set; }
Property Value
IgnoreColumn
If set to true, this property will be ignored and not mapped to any column.
Declaration
public bool IgnoreColumn { get; set; }
Property Value
PropertyName
Name of the property that should be mapped to a database column
Declaration
public string PropertyName { get; set; }
Property Value
Methods
Clone()
Declaration
Returns
Examples
public class MyPoco
{
[DbColumnMap("Column1")]
public string Prop1 { get; set; }
}
Implements
System.ICloneable