Class EntityReferenceTypeHandler
Class that handles storage format of Entity
Inheritance
Implements
Namespace: EPiServer.Data.Entity.Internal
Assembly: EPiServer.Data.dll
Version: 12.0.3Syntax
public class EntityReferenceTypeHandler : Object, ITypeHandler
Constructors
EntityReferenceTypeHandler()
Declaration
public EntityReferenceTypeHandler()
EntityReferenceTypeHandler(IEntityTypeResolver)
Declaration
public EntityReferenceTypeHandler(IEntityTypeResolver entityTypeResolver)
Parameters
Type | Name | Description |
---|---|---|
IEntity |
entityTypeResolver |
Methods
FromDatabaseFormat(String, Object, Type, Type)
Convert the value passed from the native database type (String) into an object of type Entity
Declaration
public object FromDatabaseFormat(string propertyName, object propertyValue, Type targetType, Type ownerType)
Parameters
Type | Name | Description |
---|---|---|
System. |
propertyName | The name of the property being processed |
System. |
propertyValue | The property value |
System. |
targetType | The type the value should be converted to |
System. |
ownerType | The System. |
Returns
Type | Description |
---|---|
System. |
The corresponding object of type Entity |
MapToDatabaseType(Type)
Returns the database type (string).
Declaration
public Type MapToDatabaseType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System. |
type | The type. |
Returns
Type | Description |
---|---|
System. |
The type that is stored in database |
ToDatabaseFormat(String, Object, Type)
Converts the Entity
Declaration
public object ToDatabaseFormat(string propertyName, object propertyValue, Type ownerType)
Parameters
Type | Name | Description |
---|---|---|
System. |
propertyName | The name of the property being processed |
System. |
propertyValue | The property value |
System. |
ownerType | The System. |
Returns
Type | Description |
---|---|
System. |
An object suitable for storage in the database |