Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Class EntityResolver

See IEntityResolver for example usage.

Inheritance
System.Object
EntityResolver
Implements
Namespace: EPiServer.Data.Entity.Internal
Assembly: EPiServer.Data.dll
Version: 12.0.3
Syntax
[ServiceConfiguration]
public class EntityResolver : Object, IEntityResolver

Constructors

EntityResolver()

Initializes a new instance of the EntityTypeResolver class.

Declaration
public EntityResolver()

EntityResolver(ServiceAccessor<IDatabaseExecutor>, IEntityTypeResolver)

Initializes a new instance of the EntityTypeResolver class.

Declaration
public EntityResolver(ServiceAccessor<IDatabaseExecutor> databaseHandlerFactoryMethod, IEntityTypeResolver entityTypeResolver)
Parameters
Type Name Description
ServiceAccessor<IDatabaseExecutor> databaseHandlerFactoryMethod

The factory method responsible for creating an instance of an IDatabaseExecutor when required.

IEntityTypeResolver entityTypeResolver

The entity type resolver to use to resolve entity types.

Methods

GetDatabaseHandler()

Gets an instance of the current IDatabaseExecutor handler to use for any calls to the database.

Declaration
protected IDatabaseExecutor GetDatabaseHandler()
Returns
Type Description
IDatabaseExecutor

The IDatabaseExecutor that should be used.

GetEntityReference(Guid)

Gets the EntityReference that refers to the IEntity with the specified unique identity.

Declaration
public virtual EntityReference GetEntityReference(Guid uniqueId)
Parameters
Type Name Description
System.Guid uniqueId

The unique identity of the entity.

Returns
Type Description
EntityReference

The EntityReference that referes to the IEntity with the specified unique identity or Empty if not found.

Remarks

This method will always result in a database call. Use with caution.

GetEntityUniqueID(EntityReference)

Gets the unique identity of the IEntity that is referenced by the specified EntityReference.

Declaration
public virtual Guid GetEntityUniqueID(EntityReference entityReference)
Parameters
Type Name Description
EntityReference entityReference

The reference to the entity.

Returns
Type Description
System.Guid

The unique identity of the IEntity that the specified EntityReference references. or System.Guid.Empty if no entity was found.

Remarks

This method will normally result in at least one database call. Use with caution.

Implements

Extension Methods