Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IEntityService

    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IEntityService

    Methods

    View Source

    Exists(IEnumerable<Guid>)

    Determines whether an entity exists.

    Declaration
    bool Exists(IEnumerable<Guid> keys)
    Parameters
    Type Name Description
    IEnumerable<Guid> keys

    The unique keys of the entities.

    Returns
    Type Description
    bool
    View Source

    Exists(Guid)

    Determines whether an entity exists.

    Declaration
    bool Exists(Guid key)
    Parameters
    Type Name Description
    Guid key

    The unique key of the entity.

    Returns
    Type Description
    bool
    View Source

    Exists(Guid, UmbracoObjectTypes)

    Determines whether and entity of a certain object type exists.

    Declaration
    bool Exists(Guid key, UmbracoObjectTypes objectType)
    Parameters
    Type Name Description
    Guid key

    The unique key of the entity.

    UmbracoObjectTypes objectType

    The object type to look for.

    Returns
    Type Description
    bool

    True if the entity exists, false if it does not.

    View Source

    Exists(int)

    Determines whether an entity exists.

    Declaration
    bool Exists(int id)
    Parameters
    Type Name Description
    int id

    The identifier of the entity.

    Returns
    Type Description
    bool
    View Source

    Exists(int, UmbracoObjectTypes)

    Determines whether and entity of a certain object type exists.

    Declaration
    bool Exists(int id, UmbracoObjectTypes objectType)
    Parameters
    Type Name Description
    int id

    The id of the entity.

    UmbracoObjectTypes objectType

    The object type to look for.

    Returns
    Type Description
    bool

    True if the entity exists, false if it does not.

    View Source

    Get(Guid)

    Gets an entity.

    Declaration
    IEntitySlim? Get(Guid key)
    Parameters
    Type Name Description
    Guid key

    The unique key of the entity.

    Returns
    Type Description
    IEntitySlim
    View Source

    Get(Guid, UmbracoObjectTypes)

    Gets an entity.

    Declaration
    IEntitySlim? Get(Guid key, UmbracoObjectTypes objectType)
    Parameters
    Type Name Description
    Guid key

    The unique key of the entity.

    UmbracoObjectTypes objectType

    The object type of the entity.

    Returns
    Type Description
    IEntitySlim
    View Source

    Get(int)

    Gets an entity.

    Declaration
    IEntitySlim? Get(int id)
    Parameters
    Type Name Description
    int id

    The identifier of the entity.

    Returns
    Type Description
    IEntitySlim
    View Source

    Get(int, UmbracoObjectTypes)

    Gets an entity.

    Declaration
    IEntitySlim? Get(int id, UmbracoObjectTypes objectType)
    Parameters
    Type Name Description
    int id

    The identifier of the entity.

    UmbracoObjectTypes objectType

    The object type of the entity.

    Returns
    Type Description
    IEntitySlim
    View Source

    GetAll(Guid)

    Gets entities of a given object type.

    Declaration
    IEnumerable<IEntitySlim> GetAll(Guid objectType)
    Parameters
    Type Name Description
    Guid objectType

    The object type of the entities.

    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetAll(Guid, params Guid[])

    Gets entities of a given object type.

    Declaration
    IEnumerable<IEntitySlim> GetAll(Guid objectType, params Guid[] keys)
    Parameters
    Type Name Description
    Guid objectType

    The object type of the entities.

    Guid[] keys

    The unique identifiers of the entities.

    Returns
    Type Description
    IEnumerable<IEntitySlim>
    Remarks

    If keys is empty, returns all entities.

    View Source

    GetAll(Guid, params int[])

    Gets entities of a given object type.

    Declaration
    IEnumerable<IEntitySlim> GetAll(Guid objectType, params int[] ids)
    Parameters
    Type Name Description
    Guid objectType

    The object type of the entities.

    int[] ids

    The identifiers of the entities.

    Returns
    Type Description
    IEnumerable<IEntitySlim>
    Remarks

    If ids is empty, returns all entities.

    View Source

    GetAll(UmbracoObjectTypes)

    Gets entities of a given object type.

    Declaration
    IEnumerable<IEntitySlim> GetAll(UmbracoObjectTypes objectType)
    Parameters
    Type Name Description
    UmbracoObjectTypes objectType

    The object type of the entities.

    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetAll(UmbracoObjectTypes, Guid[])

    Gets entities of a given object type.

    Declaration
    IEnumerable<IEntitySlim> GetAll(UmbracoObjectTypes objectType, Guid[] keys)
    Parameters
    Type Name Description
    UmbracoObjectTypes objectType

    The object type of the entities.

    Guid[] keys

    The unique identifiers of the entities.

    Returns
    Type Description
    IEnumerable<IEntitySlim>
    Remarks

    If keys is empty, returns all entities.

    View Source

    GetAll(UmbracoObjectTypes, params int[])

    Gets entities of a given object type.

    Declaration
    IEnumerable<IEntitySlim> GetAll(UmbracoObjectTypes objectType, params int[] ids)
    Parameters
    Type Name Description
    UmbracoObjectTypes objectType

    The object type of the entities.

    int[] ids

    The identifiers of the entities.

    Returns
    Type Description
    IEnumerable<IEntitySlim>
    Remarks

    If ids is empty, returns all entities.

    View Source

    GetAllPaths(UmbracoObjectTypes, params Guid[])

    Gets paths for entities.

    Declaration
    IEnumerable<TreeEntityPath> GetAllPaths(UmbracoObjectTypes objectType, params Guid[] keys)
    Parameters
    Type Name Description
    UmbracoObjectTypes objectType
    Guid[] keys
    Returns
    Type Description
    IEnumerable<TreeEntityPath>
    View Source

    GetAllPaths(UmbracoObjectTypes, params int[]?)

    Gets paths for entities.

    Declaration
    IEnumerable<TreeEntityPath> GetAllPaths(UmbracoObjectTypes objectType, params int[]? ids)
    Parameters
    Type Name Description
    UmbracoObjectTypes objectType
    int[] ids
    Returns
    Type Description
    IEnumerable<TreeEntityPath>
    View Source

    GetAll<T>()

    Gets entities of a given object type.

    Declaration
    IEnumerable<IEntitySlim> GetAll<T>() where T : IUmbracoEntity
    Returns
    Type Description
    IEnumerable<IEntitySlim>
    Type Parameters
    Name Description
    T

    The type used to determine the object type of the entities.

    View Source

    GetAll<T>(params Guid[])

    Gets entities of a given object type.

    Declaration
    IEnumerable<IEntitySlim> GetAll<T>(params Guid[] keys) where T : IUmbracoEntity
    Parameters
    Type Name Description
    Guid[] keys

    The unique identifiers of the entities.

    Returns
    Type Description
    IEnumerable<IEntitySlim>
    Type Parameters
    Name Description
    T

    The type used to determine the object type of the entities.

    Remarks

    If keys is empty, returns all entities.

    View Source

    GetAll<T>(params int[])

    Gets entities of a given object type.

    Declaration
    IEnumerable<IEntitySlim> GetAll<T>(params int[] ids) where T : IUmbracoEntity
    Parameters
    Type Name Description
    int[] ids

    The identifiers of the entities.

    Returns
    Type Description
    IEnumerable<IEntitySlim>
    Type Parameters
    Name Description
    T

    The type used to determine the object type of the entities.

    Remarks

    If ids is empty, returns all entities.

    View Source

    GetChildren(int)

    Gets the children of an entity.

    Declaration
    IEnumerable<IEntitySlim> GetChildren(int id)
    Parameters
    Type Name Description
    int id

    The identifier of the entity.

    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetChildren(int, UmbracoObjectTypes)

    Gets the children of an entity.

    Declaration
    IEnumerable<IEntitySlim> GetChildren(int id, UmbracoObjectTypes objectType)
    Parameters
    Type Name Description
    int id

    The identifier of the entity.

    UmbracoObjectTypes objectType

    The object type of the children.

    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetChildren(Guid?, UmbracoObjectTypes)

    Declaration
    IEnumerable<IEntitySlim> GetChildren(Guid? key, UmbracoObjectTypes objectType)
    Parameters
    Type Name Description
    Guid? key
    UmbracoObjectTypes objectType
    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetDescendants(int)

    Gets the descendants of an entity.

    Declaration
    IEnumerable<IEntitySlim> GetDescendants(int id)
    Parameters
    Type Name Description
    int id

    The identifier of the entity.

    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetDescendants(int, UmbracoObjectTypes)

    Gets the descendants of an entity.

    Declaration
    IEnumerable<IEntitySlim> GetDescendants(int id, UmbracoObjectTypes objectType)
    Parameters
    Type Name Description
    int id

    The identifier of the entity.

    UmbracoObjectTypes objectType

    The object type of the descendants.

    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetEntityType(int)

    Gets the CLR type of an entity.

    Declaration
    Type? GetEntityType(int id)
    Parameters
    Type Name Description
    int id
    Returns
    Type Description
    Type
    View Source

    GetId(Guid, UmbracoObjectTypes)

    Gets the integer identifier corresponding to a unique Guid identifier.

    Declaration
    Attempt<int> GetId(Guid key, UmbracoObjectTypes objectType)
    Parameters
    Type Name Description
    Guid key
    UmbracoObjectTypes objectType
    Returns
    Type Description
    Attempt<int>
    View Source

    GetId(Udi)

    Gets the integer identifier corresponding to a Udi.

    Declaration
    Attempt<int> GetId(Udi udi)
    Parameters
    Type Name Description
    Udi udi
    Returns
    Type Description
    Attempt<int>
    View Source

    GetKey(int, UmbracoObjectTypes)

    Gets the unique Guid identifier corresponding to an integer identifier.

    Declaration
    Attempt<Guid> GetKey(int id, UmbracoObjectTypes umbracoObjectType)
    Parameters
    Type Name Description
    int id
    UmbracoObjectTypes umbracoObjectType
    Returns
    Type Description
    Attempt<Guid>
    View Source

    GetObjectType(Guid)

    Gets the object type of an entity.

    Declaration
    UmbracoObjectTypes GetObjectType(Guid key)
    Parameters
    Type Name Description
    Guid key
    Returns
    Type Description
    UmbracoObjectTypes
    View Source

    GetObjectType(int)

    Gets the object type of an entity.

    Declaration
    UmbracoObjectTypes GetObjectType(int id)
    Parameters
    Type Name Description
    int id
    Returns
    Type Description
    UmbracoObjectTypes
    View Source

    GetObjectType(IUmbracoEntity)

    Gets the object type of an entity.

    Declaration
    UmbracoObjectTypes GetObjectType(IUmbracoEntity entity)
    Parameters
    Type Name Description
    IUmbracoEntity entity
    Returns
    Type Description
    UmbracoObjectTypes
    View Source

    GetPagedChildren(int, UmbracoObjectTypes, long, int, out long, IQuery<IUmbracoEntity>?, Ordering?)

    Gets children of an entity.

    Declaration
    IEnumerable<IEntitySlim> GetPagedChildren(int id, UmbracoObjectTypes objectType, long pageIndex, int pageSize, out long totalRecords, IQuery<IUmbracoEntity>? filter = null, Ordering? ordering = null)
    Parameters
    Type Name Description
    int id
    UmbracoObjectTypes objectType
    long pageIndex
    int pageSize
    long totalRecords
    IQuery<IUmbracoEntity> filter
    Ordering ordering
    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetPagedChildren(Guid?, IEnumerable<UmbracoObjectTypes>, IEnumerable<UmbracoObjectTypes>, int, int, bool, out long, IQuery<IUmbracoEntity>?, Ordering?)

    Declaration
    IEnumerable<IEntitySlim> GetPagedChildren(Guid? parentKey, IEnumerable<UmbracoObjectTypes> parentObjectTypes, IEnumerable<UmbracoObjectTypes> childObjectTypes, int skip, int take, bool trashed, out long totalRecords, IQuery<IUmbracoEntity>? filter = null, Ordering? ordering = null)
    Parameters
    Type Name Description
    Guid? parentKey
    IEnumerable<UmbracoObjectTypes> parentObjectTypes
    IEnumerable<UmbracoObjectTypes> childObjectTypes
    int skip
    int take
    bool trashed
    long totalRecords
    IQuery<IUmbracoEntity> filter
    Ordering ordering
    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetPagedChildren(Guid?, IEnumerable<UmbracoObjectTypes>, UmbracoObjectTypes, int, int, out long, IQuery<IUmbracoEntity>?, Ordering?)

    Declaration
    IEnumerable<IEntitySlim> GetPagedChildren(Guid? parentKey, IEnumerable<UmbracoObjectTypes> parentObjectTypes, UmbracoObjectTypes childObjectType, int skip, int take, out long totalRecords, IQuery<IUmbracoEntity>? filter = null, Ordering? ordering = null)
    Parameters
    Type Name Description
    Guid? parentKey
    IEnumerable<UmbracoObjectTypes> parentObjectTypes
    UmbracoObjectTypes childObjectType
    int skip
    int take
    long totalRecords
    IQuery<IUmbracoEntity> filter
    Ordering ordering
    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetPagedChildren(Guid?, UmbracoObjectTypes, int, int, out long, IQuery<IUmbracoEntity>?, Ordering?)

    Declaration
    IEnumerable<IEntitySlim> GetPagedChildren(Guid? parentKey, UmbracoObjectTypes childObjectType, int skip, int take, out long totalRecords, IQuery<IUmbracoEntity>? filter = null, Ordering? ordering = null)
    Parameters
    Type Name Description
    Guid? parentKey
    UmbracoObjectTypes childObjectType
    int skip
    int take
    long totalRecords
    IQuery<IUmbracoEntity> filter
    Ordering ordering
    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetPagedDescendants(IEnumerable<int>, UmbracoObjectTypes, long, int, out long, IQuery<IUmbracoEntity>?, Ordering?)

    Gets descendants of entities.

    Declaration
    IEnumerable<IEntitySlim> GetPagedDescendants(IEnumerable<int> ids, UmbracoObjectTypes objectType, long pageIndex, int pageSize, out long totalRecords, IQuery<IUmbracoEntity>? filter = null, Ordering? ordering = null)
    Parameters
    Type Name Description
    IEnumerable<int> ids
    UmbracoObjectTypes objectType
    long pageIndex
    int pageSize
    long totalRecords
    IQuery<IUmbracoEntity> filter
    Ordering ordering
    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetPagedDescendants(int, UmbracoObjectTypes, long, int, out long, IQuery<IUmbracoEntity>?, Ordering?)

    Gets descendants of an entity.

    Declaration
    IEnumerable<IEntitySlim> GetPagedDescendants(int id, UmbracoObjectTypes objectType, long pageIndex, int pageSize, out long totalRecords, IQuery<IUmbracoEntity>? filter = null, Ordering? ordering = null)
    Parameters
    Type Name Description
    int id
    UmbracoObjectTypes objectType
    long pageIndex
    int pageSize
    long totalRecords
    IQuery<IUmbracoEntity> filter
    Ordering ordering
    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetPagedDescendants(UmbracoObjectTypes, long, int, out long, IQuery<IUmbracoEntity>?, Ordering?, bool)

    Gets descendants of root.

    Declaration
    IEnumerable<IEntitySlim> GetPagedDescendants(UmbracoObjectTypes objectType, long pageIndex, int pageSize, out long totalRecords, IQuery<IUmbracoEntity>? filter = null, Ordering? ordering = null, bool includeTrashed = true)
    Parameters
    Type Name Description
    UmbracoObjectTypes objectType
    long pageIndex
    int pageSize
    long totalRecords
    IQuery<IUmbracoEntity> filter
    Ordering ordering
    bool includeTrashed
    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetPagedTrashedChildren(int, UmbracoObjectTypes, long, int, out long, IQuery<IUmbracoEntity>?, Ordering?)

    Gets children of an entity.

    Declaration
    IEnumerable<IEntitySlim> GetPagedTrashedChildren(int id, UmbracoObjectTypes objectType, long pageIndex, int pageSize, out long totalRecords, IQuery<IUmbracoEntity>? filter = null, Ordering? ordering = null)
    Parameters
    Type Name Description
    int id
    UmbracoObjectTypes objectType
    long pageIndex
    int pageSize
    long totalRecords
    IQuery<IUmbracoEntity> filter
    Ordering ordering
    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetPagedTrashedChildren(Guid?, UmbracoObjectTypes, int, int, out long, IQuery<IUmbracoEntity>?, Ordering?)

    Gets children of an entity.

    Declaration
    IEnumerable<IEntitySlim> GetPagedTrashedChildren(Guid? key, UmbracoObjectTypes objectType, int skip, int take, out long totalRecords, IQuery<IUmbracoEntity>? filter = null, Ordering? ordering = null)
    Parameters
    Type Name Description
    Guid? key
    UmbracoObjectTypes objectType
    int skip
    int take
    long totalRecords
    IQuery<IUmbracoEntity> filter
    Ordering ordering
    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetParent(int)

    Gets the parent of an entity.

    Declaration
    IEntitySlim? GetParent(int id)
    Parameters
    Type Name Description
    int id

    The identifier of the entity.

    Returns
    Type Description
    IEntitySlim
    View Source

    GetParent(int, UmbracoObjectTypes)

    Gets the parent of an entity.

    Declaration
    IEntitySlim? GetParent(int id, UmbracoObjectTypes objectType)
    Parameters
    Type Name Description
    int id

    The identifier of the entity.

    UmbracoObjectTypes objectType

    The object type of the parent.

    Returns
    Type Description
    IEntitySlim
    View Source

    GetPathKeys(ITreeEntity, bool)

    Gets the GUID keys for an entity's path (provided as a comma separated list of integer Ids).

    Declaration
    Guid[] GetPathKeys(ITreeEntity entity, bool omitSelf = false)
    Parameters
    Type Name Description
    ITreeEntity entity

    The entity.

    bool omitSelf

    A value indicating whether to omit the entity's own key from the result.

    Returns
    Type Description
    Guid[]

    The path with each ID converted to a GUID.

    View Source

    GetRootEntities(UmbracoObjectTypes)

    Gets entities at root.

    Declaration
    IEnumerable<IEntitySlim> GetRootEntities(UmbracoObjectTypes objectType)
    Parameters
    Type Name Description
    UmbracoObjectTypes objectType

    The object type of the entities.

    Returns
    Type Description
    IEnumerable<IEntitySlim>
    View Source

    GetSiblings(Guid, IEnumerable<UmbracoObjectTypes>, int, int, out long, out long, IQuery<IUmbracoEntity>?, Ordering?)

    Gets non-trashed sibling entities of a specified target entity, within a given range before and after the target, ordered as specified.

    Declaration
    IEnumerable<IEntitySlim> GetSiblings(Guid key, IEnumerable<UmbracoObjectTypes> objectTypes, int before, int after, out long totalBefore, out long totalAfter, IQuery<IUmbracoEntity>? filter = null, Ordering? ordering = null)
    Parameters
    Type Name Description
    Guid key

    The key of the target entity whose siblings are to be retrieved.

    IEnumerable<UmbracoObjectTypes> objectTypes

    The object types of the entities.

    int before

    The number of siblings to retrieve before the target entity. Needs to be greater or equal to 0.

    int after

    The number of siblings to retrieve after the target entity. Needs to be greater or equal to 0.

    long totalBefore

    Outputs the total number of siblings before the target entity.

    long totalAfter

    Outputs the total number of siblings after the target entity.

    IQuery<IUmbracoEntity> filter

    An optional filter to apply to the result set.

    Ordering ordering

    The ordering to apply to the siblings.

    Returns
    Type Description
    IEnumerable<IEntitySlim>

    Enumerable of non-trashed sibling entities.

    View Source

    GetTrashedSiblings(Guid, IEnumerable<UmbracoObjectTypes>, int, int, out long, out long, IQuery<IUmbracoEntity>?, Ordering?)

    Gets trashed sibling entities of a specified target entity, within a given range before and after the target, ordered as specified.

    Declaration
    IEnumerable<IEntitySlim> GetTrashedSiblings(Guid key, IEnumerable<UmbracoObjectTypes> objectTypes, int before, int after, out long totalBefore, out long totalAfter, IQuery<IUmbracoEntity>? filter = null, Ordering? ordering = null)
    Parameters
    Type Name Description
    Guid key

    The key of the target entity whose siblings are to be retrieved.

    IEnumerable<UmbracoObjectTypes> objectTypes

    The object types of the entities.

    int before

    The number of siblings to retrieve before the target entity. Needs to be greater or equal to 0.

    int after

    The number of siblings to retrieve after the target entity. Needs to be greater or equal to 0.

    long totalBefore

    Outputs the total number of siblings before the target entity.

    long totalAfter

    Outputs the total number of siblings after the target entity.

    IQuery<IUmbracoEntity> filter

    An optional filter to apply to the result set.

    Ordering ordering

    The ordering to apply to the siblings.

    Returns
    Type Description
    IEnumerable<IEntitySlim>

    Enumerable of trashed sibling entities.

    View Source

    Get<T>(Guid)

    Gets an entity.

    Declaration
    IEntitySlim? Get<T>(Guid key) where T : IUmbracoEntity
    Parameters
    Type Name Description
    Guid key

    The unique key of the entity.

    Returns
    Type Description
    IEntitySlim
    Type Parameters
    Name Description
    T

    The type used to determine the object type of the entity.

    View Source

    Get<T>(int)

    Gets an entity.

    Declaration
    IEntitySlim? Get<T>(int id) where T : IUmbracoEntity
    Parameters
    Type Name Description
    int id

    The identifier of the entity.

    Returns
    Type Description
    IEntitySlim
    Type Parameters
    Name Description
    T

    The type used to determine the object type of the entity.

    View Source

    ReserveId(Guid)

    Reserves an identifier for a key.

    Declaration
    int ReserveId(Guid key)
    Parameters
    Type Name Description
    Guid key

    They key.

    Returns
    Type Description
    int

    The identifier.

    Remarks

    When a new content or a media is saved with the key, it will have the reserved identifier.

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX