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.FuncMapping Class Reference

Represents a property that will be assigned the value of a user specified function when mapping. More...

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

Public Member Functions

 FuncMapping (PropertyInfo property, Func< IDataRecord, object > func)
 Creates a new instance of FuncMapping More...
 
override object GetPropertyValue (IDataRecord row)
 Gets the value for the mapped property from the row . 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

Func< IDataRecord, object > Func [get]
 Gets the function that will be used to map the properties value. More...
 
PropertyInfo Property [get]
 Gets the property that will be mapped to. More...
 

Detailed Description

Represents a property that will be assigned the value of a user specified function when mapping.

Constructor & Destructor Documentation

◆ FuncMapping()

Microsoft.Practices.EnterpriseLibrary.Data.FuncMapping.FuncMapping ( PropertyInfo  property,
Func< IDataRecord, object >  func 
)

Creates a new instance of FuncMapping

Parameters
funcThe func that will be used to map the property.
propertyThe property that will be used to map to.
Exceptions
ArgumentNullExceptionfunc is null.

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.FuncMapping.GetPropertyValue ( IDataRecord  row)
virtual

Gets the value for the mapped property from the row .

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

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

◆ Func

Func<IDataRecord, object> Microsoft.Practices.EnterpriseLibrary.Data.FuncMapping.Func
get

Gets the function that will be used to map the properties value.

◆ 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: