Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IElementEditingService

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

    Methods

    View Source

    CopyAsync(Guid, Guid?, Guid)

    Copies an element to a new location.

    Declaration
    Task<Attempt<IElement?, ContentEditingOperationStatus>> CopyAsync(Guid key, Guid? containerKey, Guid userKey)
    Parameters
    Type Name Description
    Guid key

    The unique identifier of the element to copy.

    Guid? containerKey

    The unique identifier of the container for the copy, or null for the root.

    Guid userKey

    The unique identifier of the user performing the action.

    Returns
    Type Description
    Task<Attempt<IElement, ContentEditingOperationStatus>>

    An attempt containing the copied element or an error status.

    View Source

    CreateAndPublishAsync(ElementCreateModel, string[], Guid)

    Creates and publishes a new element.

    Declaration
    Task<Attempt<ElementCreateResult, ContentEditingOperationStatus>> CreateAndPublishAsync(ElementCreateModel createModel, string[] culturesToPublish, Guid userKey)
    Parameters
    Type Name Description
    ElementCreateModel createModel

    The model containing the element data.

    string[] culturesToPublish

    The cultures to publish.

    Guid userKey

    The unique identifier of the user performing the action.

    Returns
    Type Description
    Task<Attempt<ElementCreateResult, ContentEditingOperationStatus>>

    An attempt containing the creation result or an error status.

    View Source

    CreateAsync(ElementCreateModel, Guid)

    Creates a new element.

    Declaration
    Task<Attempt<ElementCreateResult, ContentEditingOperationStatus>> CreateAsync(ElementCreateModel createModel, Guid userKey)
    Parameters
    Type Name Description
    ElementCreateModel createModel

    The model containing the element data.

    Guid userKey

    The unique identifier of the user performing the action.

    Returns
    Type Description
    Task<Attempt<ElementCreateResult, ContentEditingOperationStatus>>

    An attempt containing the creation result or an error status.

    View Source

    DeleteAsync(Guid, Guid)

    Deletes an element whether it is in the recycle bin or not.

    Declaration
    Task<Attempt<IElement?, ContentEditingOperationStatus>> DeleteAsync(Guid key, Guid userKey)
    Parameters
    Type Name Description
    Guid key

    The unique identifier of the element to delete.

    Guid userKey

    The unique identifier of the user performing the action.

    Returns
    Type Description
    Task<Attempt<IElement, ContentEditingOperationStatus>>

    An attempt containing the deleted element or an error status.

    View Source

    DeleteFromRecycleBinAsync(Guid, Guid)

    Deletes an element if it is in the recycle bin.

    Declaration
    Task<Attempt<IElement?, ContentEditingOperationStatus>> DeleteFromRecycleBinAsync(Guid key, Guid userKey)
    Parameters
    Type Name Description
    Guid key

    The unique identifier of the element to delete.

    Guid userKey

    The unique identifier of the user performing the action.

    Returns
    Type Description
    Task<Attempt<IElement, ContentEditingOperationStatus>>

    An attempt containing the deleted element or an error status.

    View Source

    GetAsync(Guid)

    Gets an element by its unique identifier.

    Declaration
    Task<IElement?> GetAsync(Guid key)
    Parameters
    Type Name Description
    Guid key

    The unique identifier of the element.

    Returns
    Type Description
    Task<IElement>

    The element, or null if not found.

    View Source

    MoveAsync(Guid, Guid?, Guid)

    Moves an element to a new container.

    Declaration
    Task<Attempt<ContentEditingOperationStatus>> MoveAsync(Guid key, Guid? containerKey, Guid userKey)
    Parameters
    Type Name Description
    Guid key

    The unique identifier of the element to move.

    Guid? containerKey

    The unique identifier of the new container, or null to move to the root.

    Guid userKey

    The unique identifier of the user performing the action.

    Returns
    Type Description
    Task<Attempt<ContentEditingOperationStatus>>

    An attempt containing the moved element or an error status.

    View Source

    MoveToRecycleBinAsync(Guid, Guid)

    Moves an element to the recycle bin.

    Declaration
    Task<Attempt<ContentEditingOperationStatus>> MoveToRecycleBinAsync(Guid key, Guid userKey)
    Parameters
    Type Name Description
    Guid key

    The unique identifier of the element to move.

    Guid userKey

    The unique identifier of the user performing the action.

    Returns
    Type Description
    Task<Attempt<ContentEditingOperationStatus>>

    An attempt containing the moved element or an error status.

    View Source

    RestoreAsync(Guid, Guid?, Guid)

    Restores an element from the recycle bin.

    Declaration
    Task<Attempt<ContentEditingOperationStatus>> RestoreAsync(Guid key, Guid? containerKey, Guid userKey)
    Parameters
    Type Name Description
    Guid key

    The unique identifier of the element to restore.

    Guid? containerKey

    The unique identifier of the container to restore to, or null for the original location.

    Guid userKey

    The unique identifier of the user performing the action.

    Returns
    Type Description
    Task<Attempt<ContentEditingOperationStatus>>

    An attempt containing the restored element or an error status.

    View Source

    UpdateAndPublishAsync(Guid, ElementUpdateModel, string[], Guid)

    Updates and publishes an existing element.

    Declaration
    Task<Attempt<ElementUpdateResult, ContentEditingOperationStatus>> UpdateAndPublishAsync(Guid key, ElementUpdateModel updateModel, string[] culturesToPublish, Guid userKey)
    Parameters
    Type Name Description
    Guid key

    The unique identifier of the element to update.

    ElementUpdateModel updateModel

    The model containing the updated element data.

    string[] culturesToPublish

    The cultures to publish.

    Guid userKey

    The unique identifier of the user performing the action.

    Returns
    Type Description
    Task<Attempt<ElementUpdateResult, ContentEditingOperationStatus>>

    An attempt containing the update result or an error status.

    View Source

    UpdateAsync(Guid, ElementUpdateModel, Guid)

    Updates an existing element.

    Declaration
    Task<Attempt<ElementUpdateResult, ContentEditingOperationStatus>> UpdateAsync(Guid key, ElementUpdateModel updateModel, Guid userKey)
    Parameters
    Type Name Description
    Guid key

    The unique identifier of the element to update.

    ElementUpdateModel updateModel

    The model containing the updated element data.

    Guid userKey

    The unique identifier of the user performing the action.

    Returns
    Type Description
    Task<Attempt<ElementUpdateResult, ContentEditingOperationStatus>>

    An attempt containing the update result or an error status.

    View Source

    ValidateCreateAsync(ElementCreateModel, Guid)

    Validates an element creation model without persisting it.

    Declaration
    Task<Attempt<ContentValidationResult, ContentEditingOperationStatus>> ValidateCreateAsync(ElementCreateModel createModel, Guid userKey)
    Parameters
    Type Name Description
    ElementCreateModel createModel

    The model containing the element data to validate.

    Guid userKey

    The unique identifier of the user performing the action.

    Returns
    Type Description
    Task<Attempt<ContentValidationResult, ContentEditingOperationStatus>>

    An attempt containing the validation result or an error status.

    View Source

    ValidateUpdateAsync(Guid, ValidateElementUpdateModel, Guid)

    Validates an element update model without persisting it.

    Declaration
    Task<Attempt<ContentValidationResult, ContentEditingOperationStatus>> ValidateUpdateAsync(Guid key, ValidateElementUpdateModel updateModel, Guid userKey)
    Parameters
    Type Name Description
    Guid key

    The unique identifier of the element to validate.

    ValidateElementUpdateModel updateModel

    The model containing the element data to validate.

    Guid userKey

    The unique identifier of the user performing the action.

    Returns
    Type Description
    Task<Attempt<ContentValidationResult, ContentEditingOperationStatus>>

    An attempt containing the validation result or an error status.

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