Search Results for

    Show / Hide Table of Contents
    View Source

    Class EntitySlim

    Implementation of IEntitySlim for internal use.

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.Models.Entities
    Assembly: Umbraco.Core.dll
    Syntax
    public class EntitySlim : IEntitySlim, IUmbracoEntity, ITreeEntity, IEntity, IDeepCloneable, IHaveAdditionalData
    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.

    Fields

    View Source

    Root

    Gets an entity representing "root".

    Declaration
    public static readonly IEntitySlim Root
    Field Value
    Type Description
    IEntitySlim

    Properties

    View Source

    AdditionalData

    Gets additional data for this entity.

    Declaration
    [DataMember]
    public IDictionary<string, object>? AdditionalData { get; }
    Property Value
    Type Description
    System.Nullable<IDictionary<System.String, System.Object>>
    Remarks

    Can be empty, but never null. To avoid allocating, do not test for emptiness, but use HasAdditionalData instead.

    View Source

    CreateDate

    Gets or sets the creation date.

    Declaration
    [DataMember]
    public DateTime CreateDate { get; set; }
    Property Value
    Type Description
    DateTime
    View Source

    CreatorId

    Gets or sets the identifier of the user who created this entity.

    Declaration
    [DataMember]
    public int CreatorId { get; set; }
    Property Value
    Type Description
    System.Int32
    View Source

    DeleteDate

    Gets or sets the delete date.

    Declaration
    [DataMember]
    public DateTime? DeleteDate { get; set; }
    Property Value
    Type Description
    System.Nullable<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).

    View Source

    HasAdditionalData

    Determines whether this entity has additional data.

    Declaration
    [IgnoreDataMember]
    public bool HasAdditionalData { get; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    Use this property to check for additional data without getting AdditionalData, to avoid allocating.

    View Source

    HasChildren

    Gets or sets a value indicating whether the entity has children.

    Declaration
    [DataMember]
    public bool HasChildren { get; set; }
    Property Value
    Type Description
    System.Boolean
    View Source

    HasIdentity

    Gets a value indicating whether the entity has an identity.

    Declaration
    [DataMember]
    public bool HasIdentity { get; }
    Property Value
    Type Description
    System.Boolean
    View Source

    Id

    Gets or sets the integer identifier of the entity.

    Declaration
    [DataMember]
    public int Id { get; set; }
    Property Value
    Type Description
    System.Int32
    View Source

    IsContainer

    Gets a value indicating whether the entity is a container.

    Declaration
    [DataMember]
    public virtual bool IsContainer { get; set; }
    Property Value
    Type Description
    System.Boolean
    View Source

    Key

    Gets or sets the Guid unique identifier of the entity.

    Declaration
    [DataMember]
    public Guid Key { get; set; }
    Property Value
    Type Description
    Guid
    View Source

    Level

    Gets or sets the level of the entity.

    Declaration
    [DataMember]
    public int Level { get; set; }
    Property Value
    Type Description
    System.Int32
    View Source

    Name

    Gets or sets the name of the entity.

    Declaration
    [DataMember]
    public string Name { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    NodeObjectType

    Gets or sets the entity object type.

    Declaration
    [DataMember]
    public Guid NodeObjectType { get; set; }
    Property Value
    Type Description
    Guid
    View Source

    ParentId

    Gets or sets the identifier of the parent entity.

    Declaration
    [DataMember]
    public int ParentId { get; set; }
    Property Value
    Type Description
    System.Int32
    View Source

    Path

    Gets or sets the path to the entity.

    Declaration
    [DataMember]
    public string Path { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    SortOrder

    Gets or sets the sort order of the entity.

    Declaration
    [DataMember]
    public int SortOrder { get; set; }
    Property Value
    Type Description
    System.Int32
    View Source

    Trashed

    Gets a value indicating whether this entity is trashed.

    Declaration
    [DataMember]
    public bool Trashed { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    Trashed entities are located in the recycle bin.

    Always false for entities that do not support being trashed.

    View Source

    UpdateDate

    Gets or sets the last update date.

    Declaration
    [DataMember]
    public DateTime UpdateDate { get; set; }
    Property Value
    Type Description
    DateTime

    Methods

    View Source

    DeepClone()

    Declaration
    public object DeepClone()
    Returns
    Type Description
    System.Object
    View Source

    GetDirtyProperties()

    Declaration
    public IEnumerable<string> GetDirtyProperties()
    Returns
    Type Description
    IEnumerable<System.String>
    View Source

    GetWereDirtyProperties()

    Declaration
    public IEnumerable<string> GetWereDirtyProperties()
    Returns
    Type Description
    IEnumerable<System.String>
    View Source

    IsDirty()

    Declaration
    public bool IsDirty()
    Returns
    Type Description
    System.Boolean
    View Source

    IsPropertyDirty(String)

    Declaration
    public bool IsPropertyDirty(string propName)
    Parameters
    Type Name Description
    System.String propName
    Returns
    Type Description
    System.Boolean
    View Source

    ResetDirtyProperties()

    Declaration
    public void ResetDirtyProperties()
    View Source

    ResetDirtyProperties(Boolean)

    Declaration
    public void ResetDirtyProperties(bool rememberDirty)
    Parameters
    Type Name Description
    System.Boolean rememberDirty
    View Source

    ResetIdentity()

    Declaration
    public void ResetIdentity()
    View Source

    ResetWereDirtyProperties()

    Declaration
    public void ResetWereDirtyProperties()
    View Source

    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.

    View Source

    WasDirty()

    Declaration
    public bool WasDirty()
    Returns
    Type Description
    System.Boolean
    View Source

    WasPropertyDirty(String)

    Declaration
    public bool WasPropertyDirty(string propertyName)
    Parameters
    Type Name Description
    System.String propertyName
    Returns
    Type Description
    System.Boolean
    • Improve this Doc
    • View Source
    In This Article
    • Fields
      • Root
    • Properties
      • AdditionalData
      • CreateDate
      • CreatorId
      • DeleteDate
      • HasAdditionalData
      • HasChildren
      • HasIdentity
      • Id
      • IsContainer
      • Key
      • Level
      • Name
      • NodeObjectType
      • ParentId
      • Path
      • SortOrder
      • Trashed
      • UpdateDate
    • Methods
      • DeepClone()
      • GetDirtyProperties()
      • GetWereDirtyProperties()
      • IsDirty()
      • IsPropertyDirty(String)
      • ResetDirtyProperties()
      • ResetDirtyProperties(Boolean)
      • ResetIdentity()
      • ResetWereDirtyProperties()
      • SetParent(ITreeEntity)
      • WasDirty()
      • WasPropertyDirty(String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX