Class ColumnMap

Namespace
Wolfgang.Etl.SqlBulkCopy
Assembly
Wolfgang.Etl.SqlBulkCopy.dll

Maps a single property on a .NET type to a column in a SQL Server table.

public sealed class ColumnMap
Inheritance
ColumnMap
Inherited Members

Remarks

The column name is determined by the ColumnAttribute if present, otherwise the property name is used. Nullable types are unwrapped to their underlying type for SQL mapping purposes.

Properties

ClrType

Gets the declared CLR type of the property, unwrapped from Nullable<T> if applicable.

public Type ClrType { get; }

Property Value

Type

Remarks

For enum properties this returns the enum type itself — not its underlying integral type. At write time the loader converts enum values to their underlying integral representation for SQL Server (e.g., a byte-backed enum is sent as tinyint), so callers inspecting ClrType to reason about the on-wire SQL payload should call GetEnumUnderlyingType() on the result when IsEnum is true.

ColumnName

Gets the name of the destination SQL column.

public string ColumnName { get; }

Property Value

string

Remarks

Defaults to PropertyName unless overridden by a ColumnAttribute.

IsNullable

Gets a value indicating whether the property can hold null.

public bool IsNullable { get; }

Property Value

bool

Ordinal

Gets the zero-based ordinal position of this column in the type map.

public int Ordinal { get; }

Property Value

int

PropertyName

Gets the name of the .NET property.

public string PropertyName { get; }

Property Value

string