Search Results for

    Show / Hide Table of Contents
    View Source

    Class ContentSavedNotification

    Notification that is published after content has been saved.

    Inheritance
    object
    StatefulNotification
    ObjectNotification<IEnumerable<IContent>>
    EnumerableObjectNotification<IContent>
    SavedNotification<IContent>
    Namespace: Umbraco.Cms.Core.Notifications
    Assembly: Umbraco.Core.dll
    Syntax
    public sealed class ContentSavedNotification : SavedNotification<IContent>, IStatefulNotification, INotification
    Remarks

    This notification is published by the IContentService after content has been persisted. It is not cancelable since the save operation has already completed.

    Constructors

    View Source

    ContentSavedNotification(IEnumerable<IContent>, EventMessages)

    Initializes a new instance of the ContentSavedNotification class with multiple content items.

    Declaration
    public ContentSavedNotification(IEnumerable<IContent> target, EventMessages messages)
    Parameters
    Type Name Description
    IEnumerable<IContent> target

    The collection of content items that were saved.

    EventMessages messages

    The event messages collection.

    View Source

    ContentSavedNotification(IEnumerable<IContent>, EventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>?)

    Initializes a new instance of the ContentSavedNotification class with multiple content items and the cultures that were saved.

    Declaration
    public ContentSavedNotification(IEnumerable<IContent> target, EventMessages messages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? savedCultures)
    Parameters
    Type Name Description
    IEnumerable<IContent> target

    The collection of content items that were saved.

    EventMessages messages

    The event messages collection.

    IReadOnlyDictionary<Guid, IReadOnlyCollection<string>> savedCultures

    The cultures that were saved, keyed by content Key.

    View Source

    ContentSavedNotification(IContent, EventMessages)

    Initializes a new instance of the ContentSavedNotification class with a single content item.

    Declaration
    public ContentSavedNotification(IContent target, EventMessages messages)
    Parameters
    Type Name Description
    IContent target

    The content item that was saved.

    EventMessages messages

    The event messages collection.

    View Source

    ContentSavedNotification(IContent, EventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>?)

    Initializes a new instance of the ContentSavedNotification class with a single content item and the cultures that were saved.

    Declaration
    public ContentSavedNotification(IContent target, EventMessages messages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? savedCultures)
    Parameters
    Type Name Description
    IContent target

    The content item that was saved.

    EventMessages messages

    The event messages collection.

    IReadOnlyDictionary<Guid, IReadOnlyCollection<string>> savedCultures

    The cultures that were saved, keyed by content Key.

    Properties

    View Source

    SavedCultures

    Gets the cultures that were saved for each content item, keyed by content Key.

    Declaration
    public IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? SavedCultures { get; }
    Property Value
    Type Description
    IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>
    Remarks

    This reports the cultures that actually changed in this save (the dirty delta), not every culture on the document. A save that changes nothing for a given document therefore reports no cultures for it. Contrast with PublishedCultures, which reports every culture explicitly published regardless of whether its data changed.

    For variant content the value is the set of cultures whose data changed; for invariant content it is the ["*"] marker, reported only when the document actually changed. A given document is absent from the dictionary when no change was tracked for it — e.g. a no-op re-save, or a sort operation.

    For variant content a culture is reported when its name or any of its property values changed (setting a value bumps that culture's date). A change to a culture-invariant (shared) property on a variant document is the exception: it belongs to no single culture, so it is not attributed to one here.

    Populated at raise-time: change tracking on the entity is reset once persisted, so this cannot be recovered from SavedEntities afterwards. The dictionary itself is null only when the notification was raised without culture information (for example via a constructor overload that does not accept it); a save that tracked cultures but changed none reports an empty dictionary, not null.

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