Interface ITypeHandler

Namespace: EPiServer.Data.Dynamic
Assembly: EPiServer.Data.dll
Version: 11.20.7
Syntax
public interface ITypeHandler

Methods

FromDatabaseFormat(String, Object, Type, Type)

Convert the value passed from the native database type into an object of type targetType

Declaration
object FromDatabaseFormat(string propertyName, object propertyValue, Type targetType, Type ownerType)
Parameters
Type Name Description
System.String propertyName

The name of the property being processed

System.Object propertyValue

The property value

System.Type targetType

The type the value should be converted to

System.Type ownerType

The System.Type of the object that owns this property

Returns
Type Description
System.Object

an object of type targetType

MapToDatabaseType(Type)

Map the Type to an "inline" type supported by Dynamic Data Store Supported types are: System.Byte, arrays of System.Byte, System.Int16, System.Int32, System.Int64, System.Enum, Identity, System.Single, System.Double, System.DateTime, System.Guid, System.String, arrays of System.Char, System.Boolean,

Declaration
Type MapToDatabaseType(Type type)
Parameters
Type Name Description
System.Type type

The CLR type to be mapped

Returns
Type Description
System.Type

The CLR type to map to

ToDatabaseFormat(String, Object, Type)

Convert the value passed into an object of the same Type returned by the MapToDatabaseType(Type) method

Declaration
object ToDatabaseFormat(string propertyName, object propertyValue, Type ownerType)
Parameters
Type Name Description
System.String propertyName

The name of the property being processed

System.Object propertyValue

The property value

System.Type ownerType

The System.Type of the object that owns this property

Returns
Type Description
System.Object

An object to store in the database

Extension Methods