DbColumnMap

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
DbColumnMap
Implements
Inherited Members
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
    public DbColumnMap()

DbColumnMap(string)

Creates a mapping between the a property and a database column

Declaration
    public DbColumnMap(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

Implements