C# Class Habanero.Base.DataMappers.GeneralDataMapper

Implements a data mapper for an unknown type. Tries to convert the value given to that type The data mapper conforms to the GOF strategy pattern DataMapper.
Inheritance: Habanero.Base.DataMappers.DataMapper
Show file Open project: Chillisoft/habanero Class Usage Examples

Public Methods

Method Description
GeneralDataMapper ( Type targetType ) : System

Creates the Generalised Data Mapper with the appropriate targetType.

TryParsePropValue ( object valueToParse, object &returnValue ) : bool

This method provides a the functionality to convert any object to the appropriate type for the particular BOProp Type. e.g it will convert a valid guid string to a valid Guid Object.

Private Methods

Method Description
CanConvertUsingTypeConverter ( object valueToParse ) : bool
GetTypeConverter ( ) : TypeConverter

Method Details

GeneralDataMapper() public method

Creates the Generalised Data Mapper with the appropriate targetType.
public GeneralDataMapper ( Type targetType ) : System
targetType System.Type The target type for mapping
return System

TryParsePropValue() public method

This method provides a the functionality to convert any object to the appropriate type for the particular BOProp Type. e.g it will convert a valid guid string to a valid Guid Object.
public TryParsePropValue ( object valueToParse, object &returnValue ) : bool
valueToParse object The value to be converted
returnValue object
return bool