Search Results for

    Show / Hide Table of Contents
    View Source

    Class ContentTypeServiceBase<TRepository, TItem>

    Inheritance
    object
    RepositoryService
    ContentTypeServiceBase
    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public abstract class ContentTypeServiceBase<TRepository, TItem> : ContentTypeServiceBase, IContentTypeBaseService<TItem>, IContentTypeBaseService, IService where TRepository : IContentTypeRepositoryBase<TItem> where TItem : class, IContentTypeComposition
    Type Parameters
    Name Description
    TRepository
    TItem

    Constructors

    View Source

    ContentTypeServiceBase(ICoreScopeProvider, ILoggerFactory, IEventMessagesFactory, TRepository, IAuditRepository, IEntityContainerRepository, IEntityRepository, IEventAggregator, IUserIdKeyResolver, ContentTypeFilterCollection)

    Declaration
    [Obsolete("Use the non-obsolete constructor instead. Scheduled removal in v19.")]
    protected ContentTypeServiceBase(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, TRepository repository, IAuditRepository auditRepository, IEntityContainerRepository containerRepository, IEntityRepository entityRepository, IEventAggregator eventAggregator, IUserIdKeyResolver userIdKeyResolver, ContentTypeFilterCollection contentTypeFilters)
    Parameters
    Type Name Description
    ICoreScopeProvider provider
    ILoggerFactory loggerFactory
    IEventMessagesFactory eventMessagesFactory
    TRepository repository
    IAuditRepository auditRepository
    IEntityContainerRepository containerRepository
    IEntityRepository entityRepository
    IEventAggregator eventAggregator
    IUserIdKeyResolver userIdKeyResolver
    ContentTypeFilterCollection contentTypeFilters
    View Source

    ContentTypeServiceBase(ICoreScopeProvider, ILoggerFactory, IEventMessagesFactory, TRepository, IAuditService, IEntityContainerRepository, IEntityRepository, IEventAggregator, IUserIdKeyResolver, ContentTypeFilterCollection)

    Declaration
    protected ContentTypeServiceBase(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, TRepository repository, IAuditService auditService, IEntityContainerRepository containerRepository, IEntityRepository entityRepository, IEventAggregator eventAggregator, IUserIdKeyResolver userIdKeyResolver, ContentTypeFilterCollection contentTypeFilters)
    Parameters
    Type Name Description
    ICoreScopeProvider provider
    ILoggerFactory loggerFactory
    IEventMessagesFactory eventMessagesFactory
    TRepository repository
    IAuditService auditService
    IEntityContainerRepository containerRepository
    IEntityRepository entityRepository
    IEventAggregator eventAggregator
    IUserIdKeyResolver userIdKeyResolver
    ContentTypeFilterCollection contentTypeFilters

    Properties

    View Source

    ContainedObjectType

    Declaration
    protected abstract Guid ContainedObjectType { get; }
    Property Value
    Type Description
    Guid
    View Source

    ContainerObjectType

    Declaration
    protected Guid ContainerObjectType { get; }
    Property Value
    Type Description
    Guid
    View Source

    ReadLockIds

    Declaration
    protected abstract int[] ReadLockIds { get; }
    Property Value
    Type Description
    int[]
    View Source

    Repository

    Declaration
    protected TRepository Repository { get; }
    Property Value
    Type Description
    TRepository
    View Source

    WriteLockIds

    Declaration
    protected abstract int[] WriteLockIds { get; }
    Property Value
    Type Description
    int[]

    Methods

    View Source

    CanDelete(TItem)

    Declaration
    protected virtual bool CanDelete(TItem item)
    Parameters
    Type Name Description
    TItem item
    Returns
    Type Description
    bool
    View Source

    Copy(TItem, int)

    Declaration
    [Obsolete("Please use CopyAsync. Will be removed in V16.")]
    public Attempt<OperationResult<MoveOperationStatusType, TItem>?> Copy(TItem copying, int containerId)
    Parameters
    Type Name Description
    TItem copying
    int containerId
    Returns
    Type Description
    Attempt<OperationResult<MoveOperationStatusType, TItem>>
    View Source

    Copy(TItem, string, string, int)

    Declaration
    [Obsolete("Please use CopyAsync. Will be removed in V15.")]
    public TItem Copy(TItem original, string alias, string name, int parentId = -1)
    Parameters
    Type Name Description
    TItem original
    string alias
    string name
    int parentId
    Returns
    Type Description
    TItem
    View Source

    Copy(TItem, string, string, TItem?)

    Declaration
    [Obsolete("Please use CopyAsync. Will be removed in V15.")]
    public TItem Copy(TItem original, string alias, string name, TItem? parent)
    Parameters
    Type Name Description
    TItem original
    string alias
    string name
    TItem parent
    Returns
    Type Description
    TItem
    View Source

    CopyAsync(Guid, Guid?)

    Declaration
    public Task<Attempt<TItem?, ContentTypeStructureOperationStatus>> CopyAsync(Guid key, Guid? containerKey)
    Parameters
    Type Name Description
    Guid key
    Guid? containerKey
    Returns
    Type Description
    Task<Attempt<TItem, ContentTypeStructureOperationStatus>>
    View Source

    Count()

    Declaration
    public int Count()
    Returns
    Type Description
    int
    View Source

    CreateAsync(TItem, Guid)

    Declaration
    public Task<Attempt<ContentTypeOperationStatus>> CreateAsync(TItem item, Guid performingUserKey)
    Parameters
    Type Name Description
    TItem item
    Guid performingUserKey
    Returns
    Type Description
    Task<Attempt<ContentTypeOperationStatus>>
    View Source

    CreateContainer(int, Guid, string, int)

    Declaration
    [Obsolete("Please use IContentTypeContainerService or IMediaTypeContainerService for all content or media type container operations. Will be removed in V16.")]
    public Attempt<OperationResult<OperationResultType, EntityContainer>?> CreateContainer(int parentId, Guid key, string name, int userId = -1)
    Parameters
    Type Name Description
    int parentId
    Guid key
    string name
    int userId
    Returns
    Type Description
    Attempt<OperationResult<OperationResultType, EntityContainer>>
    View Source

    Delete(IEnumerable<TItem>, int)

    Declaration
    public void Delete(IEnumerable<TItem> items, int userId = -1)
    Parameters
    Type Name Description
    IEnumerable<TItem> items
    int userId
    View Source

    Delete(TItem, int)

    Declaration
    public void Delete(TItem item, int userId = -1)
    Parameters
    Type Name Description
    TItem item
    int userId
    View Source

    DeleteAsync(Guid, Guid)

    Deletes an item

    Declaration
    public Task<ContentTypeOperationStatus> DeleteAsync(Guid key, Guid performingUserKey)
    Parameters
    Type Name Description
    Guid key

    The item to delete.

    Guid performingUserKey
    Returns
    Type Description
    Task<ContentTypeOperationStatus>
    View Source

    DeleteContainer(int, int)

    Declaration
    [Obsolete("Please use IContentTypeContainerService or IMediaTypeContainerService for all content or media type container operations. Will be removed in V16.")]
    public Attempt<OperationResult?> DeleteContainer(int containerId, int userId = -1)
    Parameters
    Type Name Description
    int containerId
    int userId
    Returns
    Type Description
    Attempt<OperationResult>
    View Source

    DeleteItemsOfTypes(IEnumerable<int>)

    Declaration
    protected abstract void DeleteItemsOfTypes(IEnumerable<int> typeIds)
    Parameters
    Type Name Description
    IEnumerable<int> typeIds
    View Source

    Get(Guid)

    Gets a content type.

    Declaration
    public TItem? Get(Guid id)
    Parameters
    Type Name Description
    Guid id
    Returns
    Type Description
    TItem
    View Source

    Get(int)

    Gets a content type.

    Declaration
    public TItem? Get(int id)
    Parameters
    Type Name Description
    int id
    Returns
    Type Description
    TItem
    View Source

    Get(string)

    Gets a content type.

    Declaration
    public TItem? Get(string alias)
    Parameters
    Type Name Description
    string alias
    Returns
    Type Description
    TItem
    View Source

    GetAll()

    Declaration
    public IEnumerable<TItem> GetAll()
    Returns
    Type Description
    IEnumerable<TItem>
    View Source

    GetAllAllowedAsRootAsync(int, int)

    Returns all the content type allowed as root.

    Declaration
    public Task<PagedModel<TItem>> GetAllAllowedAsRootAsync(int skip, int take)
    Parameters
    Type Name Description
    int skip
    int take
    Returns
    Type Description
    Task<PagedModel<TItem>>
    View Source

    GetAllowedChildrenAsync(Guid, int, int)

    Returns all content types allowed as children for a given content type key.

    Declaration
    public Task<Attempt<PagedModel<TItem>?, ContentTypeOperationStatus>> GetAllowedChildrenAsync(Guid key, int skip, int take)
    Parameters
    Type Name Description
    Guid key

    The content type key.

    int skip
    int take
    Returns
    Type Description
    Task<Attempt<PagedModel<TItem>, ContentTypeOperationStatus>>
    View Source

    GetAllowedChildrenAsync(Guid, Guid?, int, int)

    Returns all content types allowed as children for a given content type key.

    Declaration
    public Task<Attempt<PagedModel<TItem>?, ContentTypeOperationStatus>> GetAllowedChildrenAsync(Guid key, Guid? parentContentKey, int skip, int take)
    Parameters
    Type Name Description
    Guid key

    The content type key.

    Guid? parentContentKey

    The parent content key.

    int skip
    int take
    Returns
    Type Description
    Task<Attempt<PagedModel<TItem>, ContentTypeOperationStatus>>
    View Source

    GetAsync(Guid)

    Gets a content type.

    Declaration
    public Task<TItem?> GetAsync(Guid guid)
    Parameters
    Type Name Description
    Guid guid

    The key of the content type.

    Returns
    Type Description
    Task<TItem>

    The found content type, null if none was found.

    View Source

    GetChildren(Guid)

    Declaration
    public IEnumerable<TItem> GetChildren(Guid id)
    Parameters
    Type Name Description
    Guid id
    Returns
    Type Description
    IEnumerable<TItem>
    View Source

    GetChildren(int)

    Declaration
    public IEnumerable<TItem> GetChildren(int id)
    Parameters
    Type Name Description
    int id
    Returns
    Type Description
    IEnumerable<TItem>
    View Source

    GetComposedOf(int)

    Declaration
    public IEnumerable<TItem> GetComposedOf(int id)
    Parameters
    Type Name Description
    int id
    Returns
    Type Description
    IEnumerable<TItem>
    View Source

    GetComposedOf(int, IEnumerable<TItem>)

    Declaration
    public IEnumerable<TItem> GetComposedOf(int id, IEnumerable<TItem> all)
    Parameters
    Type Name Description
    int id
    IEnumerable<TItem> all
    Returns
    Type Description
    IEnumerable<TItem>
    View Source

    GetContainer(Guid)

    Declaration
    [Obsolete("Please use IContentTypeContainerService or IMediaTypeContainerService for all content or media type container operations. Will be removed in V16.")]
    public EntityContainer? GetContainer(Guid containerId)
    Parameters
    Type Name Description
    Guid containerId
    Returns
    Type Description
    EntityContainer
    View Source

    GetContainer(int)

    Declaration
    [Obsolete("Please use IContentTypeContainerService or IMediaTypeContainerService for all content or media type container operations. Will be removed in V16.")]
    public EntityContainer? GetContainer(int containerId)
    Parameters
    Type Name Description
    int containerId
    Returns
    Type Description
    EntityContainer
    View Source

    GetContainers(int[])

    Declaration
    [Obsolete("Please use IContentTypeContainerService or IMediaTypeContainerService for all content or media type container operations. Will be removed in V16.")]
    public IEnumerable<EntityContainer> GetContainers(int[] containerIds)
    Parameters
    Type Name Description
    int[] containerIds
    Returns
    Type Description
    IEnumerable<EntityContainer>
    View Source

    GetContainers(string, int)

    Declaration
    [Obsolete("Please use IContentTypeContainerService or IMediaTypeContainerService for all content or media type container operations. Will be removed in V16.")]
    public IEnumerable<EntityContainer> GetContainers(string name, int level)
    Parameters
    Type Name Description
    string name
    int level
    Returns
    Type Description
    IEnumerable<EntityContainer>
    View Source

    GetContainers(TItem)

    Declaration
    [Obsolete("Please use IContentTypeContainerService or IMediaTypeContainerService for all content or media type container operations. Will be removed in V16.")]
    public IEnumerable<EntityContainer> GetContainers(TItem item)
    Parameters
    Type Name Description
    TItem item
    Returns
    Type Description
    IEnumerable<EntityContainer>
    View Source

    GetContentTypeChangedNotification(IEnumerable<ContentTypeChange<TItem>>, EventMessages)

    Declaration
    protected abstract ContentTypeChangeNotification<TItem> GetContentTypeChangedNotification(IEnumerable<ContentTypeChange<TItem>> changes, EventMessages eventMessages)
    Parameters
    Type Name Description
    IEnumerable<ContentTypeChange<TItem>> changes
    EventMessages eventMessages
    Returns
    Type Description
    ContentTypeChangeNotification<TItem>
    View Source

    GetContentTypeRefreshedNotification(IEnumerable<ContentTypeChange<TItem>>, EventMessages)

    Declaration
    protected abstract ContentTypeRefreshNotification<TItem> GetContentTypeRefreshedNotification(IEnumerable<ContentTypeChange<TItem>> changes, EventMessages eventMessages)
    Parameters
    Type Name Description
    IEnumerable<ContentTypeChange<TItem>> changes
    EventMessages eventMessages
    Returns
    Type Description
    ContentTypeRefreshNotification<TItem>
    View Source

    GetDeletedNotification(IEnumerable<TItem>, EventMessages)

    Declaration
    protected abstract DeletedNotification<TItem> GetDeletedNotification(IEnumerable<TItem> items, EventMessages eventMessages)
    Parameters
    Type Name Description
    IEnumerable<TItem> items
    EventMessages eventMessages
    Returns
    Type Description
    DeletedNotification<TItem>
    View Source

    GetDeletingNotification(IEnumerable<TItem>, EventMessages)

    Declaration
    protected abstract DeletingNotification<TItem> GetDeletingNotification(IEnumerable<TItem> items, EventMessages eventMessages)
    Parameters
    Type Name Description
    IEnumerable<TItem> items
    EventMessages eventMessages
    Returns
    Type Description
    DeletingNotification<TItem>
    View Source

    GetDeletingNotification(TItem, EventMessages)

    Declaration
    protected abstract DeletingNotification<TItem> GetDeletingNotification(TItem item, EventMessages eventMessages)
    Parameters
    Type Name Description
    TItem item
    EventMessages eventMessages
    Returns
    Type Description
    DeletingNotification<TItem>
    View Source

    GetDescendants(int, bool)

    Declaration
    public IEnumerable<TItem> GetDescendants(int id, bool andSelf)
    Parameters
    Type Name Description
    int id
    bool andSelf
    Returns
    Type Description
    IEnumerable<TItem>
    View Source

    GetMany(IEnumerable<Guid>?)

    Declaration
    public IEnumerable<TItem> GetMany(IEnumerable<Guid>? ids)
    Parameters
    Type Name Description
    IEnumerable<Guid> ids
    Returns
    Type Description
    IEnumerable<TItem>
    View Source

    GetMany(params int[])

    Declaration
    public IEnumerable<TItem> GetMany(params int[] ids)
    Parameters
    Type Name Description
    int[] ids
    Returns
    Type Description
    IEnumerable<TItem>
    View Source

    GetMovedNotification(IEnumerable<MoveEventInfo<TItem>>, EventMessages)

    Declaration
    protected abstract MovedNotification<TItem> GetMovedNotification(IEnumerable<MoveEventInfo<TItem>> moveInfo, EventMessages eventMessages)
    Parameters
    Type Name Description
    IEnumerable<MoveEventInfo<TItem>> moveInfo
    EventMessages eventMessages
    Returns
    Type Description
    MovedNotification<TItem>
    View Source

    GetMovingNotification(MoveEventInfo<TItem>, EventMessages)

    Declaration
    protected abstract MovingNotification<TItem> GetMovingNotification(MoveEventInfo<TItem> moveInfo, EventMessages eventMessages)
    Parameters
    Type Name Description
    MoveEventInfo<TItem> moveInfo
    EventMessages eventMessages
    Returns
    Type Description
    MovingNotification<TItem>
    View Source

    GetSavedNotification(IEnumerable<TItem>, EventMessages)

    Declaration
    protected abstract SavedNotification<TItem> GetSavedNotification(IEnumerable<TItem> items, EventMessages eventMessages)
    Parameters
    Type Name Description
    IEnumerable<TItem> items
    EventMessages eventMessages
    Returns
    Type Description
    SavedNotification<TItem>
    View Source

    GetSavedNotification(TItem, EventMessages)

    Declaration
    protected abstract SavedNotification<TItem> GetSavedNotification(TItem item, EventMessages eventMessages)
    Parameters
    Type Name Description
    TItem item
    EventMessages eventMessages
    Returns
    Type Description
    SavedNotification<TItem>
    View Source

    GetSavingNotification(IEnumerable<TItem>, EventMessages)

    Declaration
    protected abstract SavingNotification<TItem> GetSavingNotification(IEnumerable<TItem> items, EventMessages eventMessages)
    Parameters
    Type Name Description
    IEnumerable<TItem> items
    EventMessages eventMessages
    Returns
    Type Description
    SavingNotification<TItem>
    View Source

    GetSavingNotification(TItem, EventMessages)

    Declaration
    protected abstract SavingNotification<TItem> GetSavingNotification(TItem item, EventMessages eventMessages)
    Parameters
    Type Name Description
    TItem item
    EventMessages eventMessages
    Returns
    Type Description
    SavingNotification<TItem>
    View Source

    HasChildren(Guid)

    Declaration
    public bool HasChildren(Guid id)
    Parameters
    Type Name Description
    Guid id
    Returns
    Type Description
    bool
    View Source

    HasChildren(int)

    Declaration
    public bool HasChildren(int id)
    Parameters
    Type Name Description
    int id
    Returns
    Type Description
    bool
    View Source

    HasContainerInPath(params int[])

    Gets a value indicating whether there is a list view content item in the path.

    Declaration
    public bool HasContainerInPath(params int[] ids)
    Parameters
    Type Name Description
    int[] ids
    Returns
    Type Description
    bool
    View Source

    HasContainerInPath(string)

    Given the path of a content item, this will return true if the content item exists underneath a list view content item

    Declaration
    public bool HasContainerInPath(string contentPath)
    Parameters
    Type Name Description
    string contentPath
    Returns
    Type Description
    bool
    View Source

    HasContentNodes(int)

    Returns true or false depending on whether content nodes have been created based on the provided content type id.

    Declaration
    public bool HasContentNodes(int id)
    Parameters
    Type Name Description
    int id
    Returns
    Type Description
    bool
    View Source

    Move(TItem, int)

    Declaration
    [Obsolete("Please use MoveAsync. Will be removed in V16.")]
    public Attempt<OperationResult<MoveOperationStatusType>?> Move(TItem moving, int containerId)
    Parameters
    Type Name Description
    TItem moving
    int containerId
    Returns
    Type Description
    Attempt<OperationResult<MoveOperationStatusType>>
    View Source

    MoveAsync(Guid, Guid?)

    Declaration
    public Task<Attempt<TItem?, ContentTypeStructureOperationStatus>> MoveAsync(Guid key, Guid? containerKey)
    Parameters
    Type Name Description
    Guid key
    Guid? containerKey
    Returns
    Type Description
    Task<Attempt<TItem, ContentTypeStructureOperationStatus>>
    View Source

    RenameContainer(int, string, int)

    Declaration
    [Obsolete("Please use IContentTypeContainerService or IMediaTypeContainerService for all content or media type container operations. Will be removed in V16.")]
    public Attempt<OperationResult<OperationResultType, EntityContainer>?> RenameContainer(int id, string name, int userId = -1)
    Parameters
    Type Name Description
    int id
    string name
    int userId
    Returns
    Type Description
    Attempt<OperationResult<OperationResultType, EntityContainer>>
    View Source

    Save(IEnumerable<TItem>, int)

    Declaration
    public void Save(IEnumerable<TItem> items, int userId = -1)
    Parameters
    Type Name Description
    IEnumerable<TItem> items
    int userId
    View Source

    Save(TItem?, int)

    Declaration
    public void Save(TItem? item, int userId = -1)
    Parameters
    Type Name Description
    TItem item
    int userId
    View Source

    SaveAsync(TItem, Guid)

    Declaration
    public Task SaveAsync(TItem item, Guid performingUserKey)
    Parameters
    Type Name Description
    TItem item
    Guid performingUserKey
    Returns
    Type Description
    Task
    View Source

    SaveContainer(EntityContainer, int)

    Declaration
    [Obsolete("Please use IContentTypeContainerService or IMediaTypeContainerService for all content or media type container operations. Will be removed in V16.")]
    public Attempt<OperationResult?> SaveContainer(EntityContainer container, int userId = -1)
    Parameters
    Type Name Description
    EntityContainer container
    int userId
    Returns
    Type Description
    Attempt<OperationResult>
    View Source

    UpdateAsync(TItem, Guid)

    Declaration
    public Task<Attempt<ContentTypeOperationStatus>> UpdateAsync(TItem item, Guid performingUserKey)
    Parameters
    Type Name Description
    TItem item
    Guid performingUserKey
    Returns
    Type Description
    Task<Attempt<ContentTypeOperationStatus>>
    View Source

    ValidateComposition(TItem?)

    Declaration
    public Attempt<string[]?> ValidateComposition(TItem? compo)
    Parameters
    Type Name Description
    TItem compo
    Returns
    Type Description
    Attempt<string[]>
    View Source

    ValidateLocked(TItem)

    Declaration
    protected void ValidateLocked(TItem compositionContentType)
    Parameters
    Type Name Description
    TItem compositionContentType
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX