Class EntityReferenceTypeHandler

This class supports the EPiServer infrastructure and is not intended to be used directly from your code. Class that handles storage format of EntityReference in Dynamic Data Store.

Inheritance
System.Object
EntityReferenceTypeHandler
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Data.Entity
Assembly: EPiServer.Data.dll
Version: 8.11.0
Syntax
public class EntityReferenceTypeHandler : ITypeHandler

Constructors

EntityReferenceTypeHandler()

Declaration
public EntityReferenceTypeHandler()

EntityReferenceTypeHandler(IEntityTypeResolver)

Declaration
public EntityReferenceTypeHandler(IEntityTypeResolver entityTypeResolver)
Parameters
Type Name Description
IEntityTypeResolver entityTypeResolver

Methods

FromDatabaseFormat(String, Object, Type, Type)

Convert the value passed from the native database type (String) into an object of type EntityReference.

Declaration
public 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

The corresponding object of type EntityReference

MapToDatabaseType(Type)

Returns the database type (string).

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

The type.

Returns
Type Description
System.Type

The type that is stored in database

ToDatabaseFormat(String, Object, Type)

Converts the EntityReference into a string in database format

Declaration
public 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 suitable for storage in the database

Implements

Extension Methods