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.PropertyMapping Class Referenceabstract

Base class for mapping values to properties by the ReflectionRowMapper<TResult>. More...

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

Public Member Functions

abstract object GetPropertyValue (IDataRecord row)
 When implemented by a class, extracts the value for the mapped property from row . More...
 
void Map (object instance, IDataRecord row)
 Performs the actual mapping from column to property. More...
 

Protected Member Functions

 PropertyMapping (PropertyInfo property)
 Initializes a new PropertyMapping. More...
 
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

PropertyInfo Property [get]
 Gets the property that will be mapped to. More...
 

Detailed Description

Base class for mapping values to properties by the ReflectionRowMapper<TResult>.

See also
ColumnNameMapping, FuncMapping

Constructor & Destructor Documentation

◆ PropertyMapping()

Microsoft.Practices.EnterpriseLibrary.Data.PropertyMapping.PropertyMapping ( PropertyInfo  property)
protected

Initializes a new PropertyMapping.

Member Function Documentation

◆ ConvertNonNullableValue()

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

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 
)
staticprotected

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 
)
staticprotected

Converts the database value value to conversionType .

◆ GetPropertyValue()

abstract object Microsoft.Practices.EnterpriseLibrary.Data.PropertyMapping.GetPropertyValue ( IDataRecord  row)
pure virtual

When implemented by a class, extracts the value for the mapped property from row .

Parameters
rowThe data record.
Returns
The properly converted value.

Implemented in Microsoft.Practices.EnterpriseLibrary.Data.FuncMapping, and Microsoft.Practices.EnterpriseLibrary.Data.ColumnNameMapping.

◆ Map()

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

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 
)
protected

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

◆ Property

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

Gets the property that will be mapped to.


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