Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IContentEditingService

    Provides editing services for content items.

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

    Methods

    View Source

    CopyAsync(Guid, Guid?, bool, bool, Guid)

    Copies a content item to a new location.

    Declaration
    Task<Attempt<IContent?, ContentEditingOperationStatus>> CopyAsync(Guid key, Guid? parentKey, bool relateToOriginal, bool includeDescendants, Guid userKey)
    Parameters
    Type Name Description
    Guid key

    The unique identifier of the content item to copy.

    Guid? parentKey

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

    bool relateToOriginal

    Whether to create a relation between the copy and the original.

    bool includeDescendants

    Whether to also copy all descendant content items.

    Guid userKey

    The unique identifier of the user performing the action.

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

    An attempt containing the copied content item or an error status.

    View Source

    CreateAsync(ContentCreateModel, Guid)

    Creates a new content item.

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

    The model containing the content data.

    Guid userKey

    The unique identifier of the user performing the action.

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

    An attempt containing the creation result or an error status.

    View Source

    DeleteAsync(Guid, Guid)

    Deletes a content item whether it is in the recycle bin or not.

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

    The unique identifier of the content item to delete.

    Guid userKey

    The unique identifier of the user performing the action.

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

    An attempt containing the deleted content item or an error status.

    View Source

    DeleteFromRecycleBinAsync(Guid, Guid)

    Deletes a content item if it is in the recycle bin.

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

    The unique identifier of the content item to delete.

    Guid userKey

    The unique identifier of the user performing the action.

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

    An attempt containing the deleted content item or an error status.

    View Source

    GetAsync(Guid)

    Gets a content item by its unique identifier.

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

    The unique identifier of the content item.

    Returns
    Type Description
    Task<IContent>

    The content item, or null if not found.

    View Source

    MoveAsync(Guid, Guid?, Guid)

    Moves a content item to a new parent.

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

    The unique identifier of the content item to move.

    Guid? parentKey

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

    Guid userKey

    The unique identifier of the user performing the action.

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

    An attempt containing the moved content item or an error status.

    View Source

    MoveToRecycleBinAsync(Guid, Guid)

    Moves a content item to the recycle bin.

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

    The unique identifier of the content item to move.

    Guid userKey

    The unique identifier of the user performing the action.

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

    An attempt containing the moved content item or an error status.

    View Source

    RestoreAsync(Guid, Guid?, Guid)

    Restores a content item from the recycle bin.

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

    The unique identifier of the content item to restore.

    Guid? parentKey

    The unique identifier of the parent 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<IContent, ContentEditingOperationStatus>>

    An attempt containing the restored content item or an error status.

    View Source

    SortAsync(Guid?, IEnumerable<SortingModel>, Guid)

    Sorts content items under a parent.

    Declaration
    Task<ContentEditingOperationStatus> SortAsync(Guid? parentKey, IEnumerable<SortingModel> sortingModels, Guid userKey)
    Parameters
    Type Name Description
    Guid? parentKey

    The unique identifier of the parent, or null for root-level sorting.

    IEnumerable<SortingModel> sortingModels

    The collection of sorting models defining the new order.

    Guid userKey

    The unique identifier of the user performing the action.

    Returns
    Type Description
    Task<ContentEditingOperationStatus>

    The operation status indicating success or failure.

    View Source

    UpdateAsync(Guid, ContentUpdateModel, Guid)

    Updates an existing content item.

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

    The unique identifier of the content item to update.

    ContentUpdateModel updateModel

    The model containing the updated content data.

    Guid userKey

    The unique identifier of the user performing the action.

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

    An attempt containing the update result or an error status.

    View Source

    ValidateCreateAsync(ContentCreateModel, Guid)

    Validates a content creation model without persisting it.

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

    The model containing the content 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, ValidateContentUpdateModel, Guid)

    Validates a content update model without persisting it.

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

    The unique identifier of the content item to validate.

    ValidateContentUpdateModel updateModel

    The model containing the content 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