Enterprise Library Data Access Application Block  7.0-rc1
The Data Access Application Block abstracts the actual database you are using, and exposes a collection of methods that make it easy to access that database and to perform common tasks.
Microsoft.Practices.EnterpriseLibrary.Data.ColumnNameMapping Class Reference

Represents the mapping from a database column to a PropertyInfo. More...

Inheritance diagram for Microsoft.Practices.EnterpriseLibrary.Data.ColumnNameMapping:
Microsoft.Practices.EnterpriseLibrary.Data.PropertyMapping

Public Member Functions

 ColumnNameMapping (PropertyInfo property, string columnName)
 Creates a new instance of ColumnNameMapping More...
 
override object GetPropertyValue (IDataRecord row)
 Converts the value for the column in the row with a name matching that of the mapped property to the type of the property. More...
 
void Map (object instance, IDataRecord row)
 Performs the actual mapping from column to property. More...
 

Protected Member Functions

void SetValue (object instance, object value)
 Sets the value to instance using PropertyMapping.Property. More...
 

Static Protected Member Functions

static object ConvertValue (object value, Type conversionType)
 Converts the database value value to conversionType . More...
 
static object ConvertNullableValue (object value, Type conversionType)
 Converts the database value value to conversionType , where conversionType is a nullable value. More...
 
static object ConvertNonNullableValue (object value, Type conversionType)
 Converts the database value value to conversionType . Will throw an exception if conversionType is a nullable value. More...
 

Properties

string ColumnName [get]
 Gets the name of the column that is used for mapping. More...
 
PropertyInfo Property [get]
 Gets the property that will be mapped to. More...
 

Detailed Description

Represents the mapping from a database column to a PropertyInfo.

Constructor & Destructor Documentation

◆ ColumnNameMapping()

Microsoft.Practices.EnterpriseLibrary.Data.ColumnNameMapping.ColumnNameMapping ( PropertyInfo  property,
string  columnName 
)

Creates a new instance of ColumnNameMapping

Parameters
columnNameThe name of the column that will be used for mapping.
propertyThe property that will be used to map to.

Member Function Documentation

◆ ConvertNonNullableValue()

static object Microsoft.Practices.EnterpriseLibrary.Data.PropertyMapping.ConvertNonNullableValue ( object  value,
Type  conversionType 
)
staticprotectedinherited

Converts the database value value to conversionType . Will throw an exception if conversionType is a nullable value.

Parameters
valueValue from the database.
conversionTypeType to convert to.
Returns
The converted value.

◆ ConvertNullableValue()

static object Microsoft.Practices.EnterpriseLibrary.Data.PropertyMapping.ConvertNullableValue ( object  value,
Type  conversionType 
)
staticprotectedinherited

Converts the database value value to conversionType , where conversionType is a nullable value.

Parameters
valueValue from the database.
conversionTypeType to convert to.
Returns
The converted value.

◆ ConvertValue()

static object Microsoft.Practices.EnterpriseLibrary.Data.PropertyMapping.ConvertValue ( object  value,
Type  conversionType 
)
staticprotectedinherited

Converts the database value value to conversionType .

◆ GetPropertyValue()

override object Microsoft.Practices.EnterpriseLibrary.Data.ColumnNameMapping.GetPropertyValue ( IDataRecord  row)
virtual

Converts the value for the column in the row with a name matching that of the mapped property to the type of the property.

Parameters
rowThe data record.
Returns
The value for the corresponding column converted to the type of the mapped property.
Exceptions
ArgumentNullExceptionrow is null.

Implements Microsoft.Practices.EnterpriseLibrary.Data.PropertyMapping.

◆ Map()

void Microsoft.Practices.EnterpriseLibrary.Data.PropertyMapping.Map ( object  instance,
IDataRecord  row 
)
inherited

Performs the actual mapping from column to property.

Parameters
instanceThe object that contains the PropertyMapping.Property.
rowThe row that contains the ColumnNameMapping.ColumnName.

◆ SetValue()

void Microsoft.Practices.EnterpriseLibrary.Data.PropertyMapping.SetValue ( object  instance,
object  value 
)
protectedinherited

Sets the value to instance using PropertyMapping.Property.

Parameters
instanceThe object value will be assigned to.
valueThe value that will be assigned to instance .

Property Documentation

◆ ColumnName

string Microsoft.Practices.EnterpriseLibrary.Data.ColumnNameMapping.ColumnName
get

Gets the name of the column that is used for mapping.

◆ Property

PropertyInfo Microsoft.Practices.EnterpriseLibrary.Data.PropertyMapping.Property
getinherited

Gets the property that will be mapped to.


The documentation for this class was generated from the following file: