Class EntityResolver
This class supports the EPiServer infrastructure and is not intended to be used directly from your code. See IEntityResolver for example usage.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Data.Entity
Assembly: EPiServer.Data.dll
Version: 8.11.0Syntax
[ServiceConfiguration(typeof(IEntityResolver), Lifecycle = ServiceInstanceScope.Singleton)]
public class EntityResolver : IEntityResolver
Constructors
EntityResolver()
Initializes a new instance of the EntityTypeResolver class.
Declaration
public EntityResolver()
EntityResolver(ServiceAccessor<IDatabaseHandler>, IEntityTypeResolver)
Initializes a new instance of the EntityTypeResolver class.
Declaration
public EntityResolver(ServiceAccessor<IDatabaseHandler> databaseHandlerFactoryMethod, IEntityTypeResolver entityTypeResolver)
Parameters
Type | Name | Description |
---|---|---|
ServiceAccessor<IDatabaseHandler> | databaseHandlerFactoryMethod | The factory method responsible for creating an instance of an IDatabaseHandler when required. |
IEntityTypeResolver | entityTypeResolver | The entity type resolver to use to resolve entity types. |
Methods
GetDatabaseHandler()
Gets an instance of the current IDatabaseHandler handler to use for any calls to the database.
Declaration
protected IDatabaseHandler GetDatabaseHandler()
Returns
Type | Description |
---|---|
IDatabaseHandler | The IDatabaseHandler 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.