Interface IEntityTypeResolver
Interface that defines a service that resolves Entity types and identities.
Namespace: EPiServer.Data.Entity
Assembly: EPiServer.Data.dll
Version: 12.0.3Syntax
public interface IEntityTypeResolver
Examples
Example that gets an ID of a type and then reads the same type back again by ID
public void Sample()
{
IEntityTypeResolver resolver = ServiceLocator.Current.GetInstance<IEntityTypeResolver>();
//Get the ID for the type
int typeID = resolver.GetTypeID(typeof(MyEntity));
//Get back the type of an ID
Type type = resolver.GetTypeByID(typeID);
}
Methods
GetTypeByID(Int32)
Gets the System.id
in the database.
Declaration
Type GetTypeByID(int id)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The ID for which to get the System. |
Returns
Type | Description |
---|---|
System. |
The System. |
GetTypeID(Type, Boolean)
Gets the ID representing a System.
Declaration
int GetTypeID(Type type, bool ignoreOverrideAttribute)
Parameters
Type | Name | Description |
---|---|---|
System. |
type | The System. |
System. |
ignoreOverrideAttribute | Whether to ignore the Entity |
Returns
Type | Description |
---|---|
System. |
Returns the integer ID that represents the |
GetTypeName(Type, Boolean)
Gets the name of a System.
Declaration
string GetTypeName(Type type, bool ignoreOverrideAttribute)
Parameters
Type | Name | Description |
---|---|---|
System. |
type | The System. |
System. |
ignoreOverrideAttribute | Whether to ignore the Entity |
Returns
Type | Description |
---|---|
System. |
The type name. |