Class EntitySlim
Implementation of IEntitySlim for internal use.
Inheritance
Namespace: Umbraco.Cms.Core.Models.Entities
Assembly: Umbraco.Core.dll
Syntax
public class EntitySlim : IEntitySlim, IUmbracoEntity, ITreeEntity, IEntity, IDeepCloneable
Remarks
Although it implements IEntitySlim, this class does not implement IRememberBeingDirty and everything this interface defines, throws.
Although it implements IEntitySlim, this class does not implement IDeepCloneable and deep-cloning throws.
Constructors
View SourceEntitySlim()
Declaration
public EntitySlim()
Fields
View SourceRoot
Gets an entity representing "root".
Declaration
public static readonly IEntitySlim Root
Field Value
| Type | Description |
|---|---|
| IEntitySlim |
Properties
View SourceCreateDate
Gets or sets the creation date.
Declaration
[DataMember]
public DateTime CreateDate { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime |
CreatorId
Gets or sets the identifier of the user who created this entity.
Declaration
[DataMember]
public int CreatorId { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
DeleteDate
Gets or sets the delete date.
Declaration
[DataMember]
public DateTime? DeleteDate { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime? |
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).
HasChildren
Gets or sets a value indicating whether the entity has children.
Declaration
[DataMember]
public bool HasChildren { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
HasIdentity
Gets a value indicating whether the entity has an identity.
Declaration
[DataMember]
public bool HasIdentity { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Id
Gets or sets the integer identifier of the entity.
Declaration
[DataMember]
public int Id { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
IsContainer
Gets a value indicating whether the entity is a container.
Declaration
[DataMember]
public virtual bool IsContainer { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Key
Gets or sets the Guid unique identifier of the entity.
Declaration
[DataMember]
public Guid Key { get; set; }
Property Value
| Type | Description |
|---|---|
| Guid |
Level
Gets or sets the level of the entity.
Declaration
[DataMember]
public int Level { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Name
Gets or sets the name of the entity.
Declaration
[DataMember]
public string? Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
NodeObjectType
Gets or sets the entity object type.
Declaration
[DataMember]
public Guid NodeObjectType { get; set; }
Property Value
| Type | Description |
|---|---|
| Guid |
ParentId
Gets or sets the identifier of the parent entity.
Declaration
[DataMember]
public int ParentId { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Path
Gets or sets the path to the entity.
Declaration
[DataMember]
public string Path { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
SortOrder
Gets or sets the sort order of the entity.
Declaration
[DataMember]
public int SortOrder { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Trashed
Gets a value indicating whether this entity is trashed.
Declaration
[DataMember]
public bool Trashed { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
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
[DataMember]
public DateTime UpdateDate { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime |
Methods
View SourceDeepClone()
Not implemented. Always throws System.InvalidOperationException.
Declaration
public object DeepClone()
Returns
| Type | Description |
|---|---|
| object |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Always thrown as this method is not implemented. |
GetDirtyProperties()
Not implemented. Always throws System.InvalidOperationException.
Declaration
public IEnumerable<string> GetDirtyProperties()
Returns
| Type | Description |
|---|---|
| IEnumerable<string> |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Always thrown as this method is not implemented. |
GetWereDirtyProperties()
Not implemented. Always throws System.InvalidOperationException.
Declaration
public IEnumerable<string> GetWereDirtyProperties()
Returns
| Type | Description |
|---|---|
| IEnumerable<string> |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Always thrown as this method is not implemented. |
IsDirty()
Not implemented. Always throws System.InvalidOperationException.
Declaration
public bool IsDirty()
Returns
| Type | Description |
|---|---|
| bool |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Always thrown as this method is not implemented. |
IsPropertyDirty(string)
Not implemented. Always throws System.InvalidOperationException.
Declaration
public bool IsPropertyDirty(string propName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propName | The property name. |
Returns
| Type | Description |
|---|---|
| bool |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Always thrown as this method is not implemented. |
ResetDirtyProperties()
Not implemented. Always throws System.InvalidOperationException.
Declaration
public void ResetDirtyProperties()
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Always thrown as this method is not implemented. |
ResetDirtyProperties(bool)
Not implemented. Always throws System.InvalidOperationException.
Declaration
public void ResetDirtyProperties(bool rememberDirty)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | rememberDirty | A value indicating whether to remember dirty properties. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Always thrown as this method is not implemented. |
ResetIdentity()
Declaration
public void ResetIdentity()
ResetWereDirtyProperties()
Not implemented. Always throws System.InvalidOperationException.
Declaration
public void ResetWereDirtyProperties()
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Always thrown as this method is not implemented. |
SetParent(ITreeEntity?)
Sets the parent entity.
Declaration
public void SetParent(ITreeEntity? parent)
Parameters
| Type | Name | Description |
|---|---|---|
| ITreeEntity | 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 ParentId getter.
WasDirty()
Not implemented. Always throws System.InvalidOperationException.
Declaration
public bool WasDirty()
Returns
| Type | Description |
|---|---|
| bool |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Always thrown as this method is not implemented. |
WasPropertyDirty(string)
Not implemented. Always throws System.InvalidOperationException.
Declaration
public bool WasPropertyDirty(string propertyName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propertyName | The property name. |
Returns
| Type | Description |
|---|---|
| bool |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Always thrown as this method is not implemented. |