Interface IEntityResolver
Defines a service that can resolve an EntityReference to the unique identity of the referenced IEntity and vice versa.
Namespace: EPiServer.Data.Entity
Assembly: EPiServer.Data.dll
Version: 7.19.2Syntax
public interface IEntityResolver
Examples
Load an IEntity by unique id
Methods
GetEntityReference(Guid)
Gets an EntityReference to the IEntity with the specified unique identity.
Declaration
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 given unique identity, or Empty if not found. |
GetEntityUniqueID(EntityReference)
Gets the unique identity of the IEntity that is referenced by the specified EntityReference.
Declaration
Guid GetEntityUniqueID(EntityReference entityReference)
Parameters
Type | Name | Description |
---|---|---|
EntityReference | entityReference | A reference to the entity. |
Returns
Type | Description |
---|---|
System.Guid | The unique identity of the IEntity that the given EntityReference refers to, or System.Guid.Empty if not found. |