Search Results for

    Show / Hide Table of Contents
    View Source

    Class DomainService

    Provides services for managing domains (hostnames and culture assignments for content).

    Inheritance
    object
    RepositoryService
    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public class DomainService : RepositoryService, IDomainService, IService

    Constructors

    View Source

    DomainService(ICoreScopeProvider, ILoggerFactory, IEventMessagesFactory, IDomainRepository, ILanguageService, IContentService)

    Initializes a new instance of the DomainService class.

    Declaration
    public DomainService(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, IDomainRepository domainRepository, ILanguageService languageService, IContentService contentService)
    Parameters
    Type Name Description
    ICoreScopeProvider provider

    The core scope provider.

    ILoggerFactory loggerFactory

    The logger factory.

    IEventMessagesFactory eventMessagesFactory

    The event messages factory.

    IDomainRepository domainRepository

    The domain repository.

    ILanguageService languageService

    The language service.

    IContentService contentService

    The content service.

    Methods

    View Source

    Exists(string)

    Checks if a domain with the specified name exists.

    Declaration
    public bool Exists(string domainName)
    Parameters
    Type Name Description
    string domainName

    The domain name to check.

    Returns
    Type Description
    bool

    true if the domain exists; otherwise, false.

    View Source

    GetAllAsync(bool)

    Gets all assigned domains.

    Declaration
    public Task<IEnumerable<IDomain>> GetAllAsync(bool includeWildcards)
    Parameters
    Type Name Description
    bool includeWildcards

    Whether to include wildcard domains.

    Returns
    Type Description
    Task<IEnumerable<IDomain>>

    A collection of all domains.

    View Source

    GetAssignedDomainsAsync(Guid, bool)

    Gets all assigned domains for a content item.

    Declaration
    public Task<IEnumerable<IDomain>> GetAssignedDomainsAsync(Guid contentKey, bool includeWildcards)
    Parameters
    Type Name Description
    Guid contentKey

    The unique identifier of the content item.

    bool includeWildcards

    Whether to include wildcard domains.

    Returns
    Type Description
    Task<IEnumerable<IDomain>>

    A collection of domains assigned to the content item.

    View Source

    GetById(int)

    Gets a domain by its identifier.

    Declaration
    public IDomain? GetById(int id)
    Parameters
    Type Name Description
    int id

    The domain identifier.

    Returns
    Type Description
    IDomain

    The domain, or null if not found.

    View Source

    GetByName(string)

    Gets a domain by its name.

    Declaration
    public IDomain? GetByName(string name)
    Parameters
    Type Name Description
    string name

    The domain name.

    Returns
    Type Description
    IDomain

    The domain, or null if not found.

    View Source

    UpdateDomainsAsync(Guid, DomainsUpdateModel)

    Updates the domain assignments for a content item.

    Declaration
    public Task<Attempt<DomainUpdateResult, DomainOperationStatus>> UpdateDomainsAsync(Guid contentKey, DomainsUpdateModel updateModel)
    Parameters
    Type Name Description
    Guid contentKey

    The unique identifier of the content item.

    DomainsUpdateModel updateModel

    The domain assignments to apply.

    Returns
    Type Description
    Task<Attempt<DomainUpdateResult, DomainOperationStatus>>

    An attempt containing the update result or an error status.

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