Class EntitySlim
Implementation of IEntity
Inheritance
Namespace: Umbraco.Cms.Core.Models.Entities
Assembly: Umbraco.Core.dll
Syntax
public class EntitySlim : object, IEntitySlim, IUmbracoEntity, ITreeEntity, IEntity, IDeepCloneable, IHaveAdditionalData
Remarks
Although it implements IEntity
Although it implements IEntity
Fields
View SourceRoot
Gets an entity representing "root".
Declaration
public static readonly IEntitySlim Root
Field Value
Type | Description |
---|---|
IEntity |
Properties
View SourceAdditionalData
Gets additional data for this entity.
Declaration
public IDictionary<string, object> AdditionalData { get; }
Property Value
Type | Description |
---|---|
IDictionary<System. |
Remarks
Can be empty, but never null. To avoid allocating, do not
test for emptiness, but use Has
CreateDate
Gets or sets the creation date.
Declaration
public DateTime CreateDate { get; set; }
Property Value
Type | Description |
---|---|
Date |
CreatorId
Gets or sets the identifier of the user who created this entity.
Declaration
public int CreatorId { get; set; }
Property Value
Type | Description |
---|---|
System. |
DeleteDate
Gets or sets the delete date.
Declaration
public DateTime? DeleteDate { get; set; }
Property Value
Type | Description |
---|---|
System. |
Remarks
The delete date is null when the entity has not been deleted.
The delete date has a value when the entity instance has been deleted, but this value is transient and not persisted in database (since the entity does not exist anymore).
HasAdditionalData
Determines whether this entity has additional data.
Declaration
public bool HasAdditionalData { get; }
Property Value
Type | Description |
---|---|
System. |
Remarks
Use this property to check for additional data without
getting Additional
HasChildren
Gets or sets a value indicating whether the entity has children.
Declaration
public bool HasChildren { get; set; }
Property Value
Type | Description |
---|---|
System. |
HasIdentity
Gets a value indicating whether the entity has an identity.
Declaration
public bool HasIdentity { get; }
Property Value
Type | Description |
---|---|
System. |
Id
Gets or sets the integer identifier of the entity.
Declaration
public int Id { get; set; }
Property Value
Type | Description |
---|---|
System. |
IsContainer
Gets a value indicating whether the entity is a container.
Declaration
public virtual bool IsContainer { get; set; }
Property Value
Type | Description |
---|---|
System. |
Key
Gets or sets the Guid unique identifier of the entity.
Declaration
public Guid Key { get; set; }
Property Value
Type | Description |
---|---|
Guid |
Level
Gets or sets the level of the entity.
Declaration
public int Level { get; set; }
Property Value
Type | Description |
---|---|
System. |
Name
Gets or sets the name of the entity.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System. |
NodeObjectType
Gets or sets the entity object type.
Declaration
public Guid NodeObjectType { get; set; }
Property Value
Type | Description |
---|---|
Guid |
ParentId
Gets or sets the identifier of the parent entity.
Declaration
public int ParentId { get; set; }
Property Value
Type | Description |
---|---|
System. |
Path
Gets or sets the path to the entity.
Declaration
public string Path { get; set; }
Property Value
Type | Description |
---|---|
System. |
SortOrder
Gets or sets the sort order of the entity.
Declaration
public int SortOrder { get; set; }
Property Value
Type | Description |
---|---|
System. |
Trashed
Gets a value indicating whether this entity is trashed.
Declaration
public bool Trashed { get; set; }
Property Value
Type | Description |
---|---|
System. |
Remarks
Trashed entities are located in the recycle bin.
Always false for entities that do not support being trashed.
UpdateDate
Gets or sets the last update date.
Declaration
public DateTime UpdateDate { get; set; }
Property Value
Type | Description |
---|---|
Date |
Methods
View SourceDeepClone()
Declaration
public object DeepClone()
Returns
Type | Description |
---|---|
System. |
GetDirtyProperties()
Declaration
public IEnumerable<string> GetDirtyProperties()
Returns
Type | Description |
---|---|
IEnumerable<System. |
GetWereDirtyProperties()
Declaration
public IEnumerable<string> GetWereDirtyProperties()
Returns
Type | Description |
---|---|
IEnumerable<System. |
IsDirty()
Declaration
public bool IsDirty()
Returns
Type | Description |
---|---|
System. |
IsPropertyDirty(String)
Declaration
public bool IsPropertyDirty(string propName)
Parameters
Type | Name | Description |
---|---|---|
System. |
propName |
Returns
Type | Description |
---|---|
System. |
ResetDirtyProperties()
Declaration
public void ResetDirtyProperties()
ResetDirtyProperties(Boolean)
Declaration
public void ResetDirtyProperties(bool rememberDirty)
Parameters
Type | Name | Description |
---|---|---|
System. |
rememberDirty |
ResetIdentity()
Declaration
public void ResetIdentity()
ResetWereDirtyProperties()
Declaration
public void ResetWereDirtyProperties()
SetParent(ITreeEntity)
Sets the parent entity.
Declaration
public void SetParent(ITreeEntity parent)
Parameters
Type | Name | Description |
---|---|---|
ITree |
parent |
Remarks
Use this method to set the parent entity when the parent entity is known, but has not
been persistent and does not yet have an identity. The parent identifier will be retrieved
from the parent entity when needed. If the parent entity still does not have an entity by that
time, an exception will be thrown by Parent
WasDirty()
Declaration
public bool WasDirty()
Returns
Type | Description |
---|---|
System. |
WasPropertyDirty(String)
Declaration
public bool WasPropertyDirty(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
System. |
propertyName |
Returns
Type | Description |
---|---|
System. |