Class EntityReference
A light-weight reference to an IEntity primarily used to save references to other entities
Inheritance
System.Object
EntityReference
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: EPiServer.Data.dll
Version: 7.19.2
Syntax
public class EntityReference
Constructors
EntityReference()
Declaration
protected EntityReference()
EntityReference(Type, Int32)
Initializes a new instance of this class.
Declaration
public EntityReference(Type type, int id)
Parameters
Type |
Name |
Description |
System.Type |
type |
The type of the entity
|
System.Int32 |
id |
The ID of the entity
|
Properties
Empty
Declaration
public static EntityReference Empty { get; }
Property Value
ID
Declaration
public int ID { get; protected set; }
Property Value
Type |
Description |
System.Int32 |
|
Type
Declaration
public Type Type { get; }
Property Value
Type |
Description |
System.Type |
|
Methods
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.Object.Equals(System.Object)
GetEntityType(Type)
Declaration
public static Type GetEntityType(Type originalType)
Parameters
Type |
Name |
Description |
System.Type |
originalType |
The Type to inspect
|
Returns
Type |
Description |
System.Type |
Returns the Type designated as EntityType. If no EntityTypeOverrideAttribute could be found in the
inheritance chain, it returns the type supplied in originalType .
|
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.Object.GetHashCode()
ToEntityReference(IEntity)
Declaration
public static EntityReference ToEntityReference(IEntity entity)
Parameters
Type |
Name |
Description |
IEntity |
entity |
The entity to which you want to get a reference
|
Returns
Operators
Equality(EntityReference, EntityReference)
Declaration
public static bool operator ==(EntityReference entity1, EntityReference entity2)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Inequality(EntityReference, EntityReference)
Declaration
public static bool operator !=(EntityReference entity1, EntityReference entity2)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Extension Methods