Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IContentTypeService

    Manages IContentType objects.

    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IContentTypeService : IContentTypeBaseService<IContentType>, IContentTypeBaseService, IService

    Methods

    View Source

    CreateTemplateAsync(Guid, string, string, bool, Guid)

    Creates a template for the given content type.

    Declaration
    Task<Attempt<Guid?, ContentTypeOperationStatus>> CreateTemplateAsync(Guid contentTypeKey, string templateName, string templateAlias, bool isDefaultTemplate, Guid userKey)
    Parameters
    Type Name Description
    Guid contentTypeKey

    The content type key.

    string templateName

    The name of the template to create.

    string templateAlias

    The alias of the template to create.

    bool isDefaultTemplate

    Whether to set the template as the default template for the content type.

    Guid userKey

    The key of the user performing the operation.

    Returns
    Type Description
    Task<Attempt<Guid?, ContentTypeOperationStatus>>

    An attempt containing the template's key if successful, or an error status if not.

    View Source

    GetAllContentTypeAliases(params Guid[])

    Gets all content type aliases

    Declaration
    IEnumerable<string> GetAllContentTypeAliases(params Guid[] objectTypes)
    Parameters
    Type Name Description
    Guid[] objectTypes

    If this list is empty, it will return all content type aliases for media, members and content, otherwise it will only return content type aliases for the object types specified

    Returns
    Type Description
    IEnumerable<string>

    An enumerable collection of content type aliases.

    View Source

    GetAllContentTypeIds(string[])

    Returns all content type Ids for the aliases given.

    Declaration
    IEnumerable<int> GetAllContentTypeIds(string[] aliases)
    Parameters
    Type Name Description
    string[] aliases

    The content type aliases to look up.

    Returns
    Type Description
    IEnumerable<int>

    An enumerable collection of content type identifiers.

    View Source

    GetAllPropertyTypeAliases()

    Gets all property type aliases.

    Declaration
    IEnumerable<string> GetAllPropertyTypeAliases()
    Returns
    Type Description
    IEnumerable<string>

    An enumerable collection of all property type aliases.

    View Source

    GetByQueryAsync(IQuery<IContentType>, CancellationToken)

    Gets content types matching the specified query.

    Declaration
    Task<IEnumerable<IContentType>> GetByQueryAsync(IQuery<IContentType> query, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IQuery<IContentType> query

    The query to filter content types.

    CancellationToken cancellationToken

    A cancellation token to cancel the operation.

    Returns
    Type Description
    Task<IEnumerable<IContentType>>

    A task that represents the asynchronous operation. The task result contains the matching content types.

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