Class ElementSavedNotification
A notification that is used to trigger the IElementService when the Save method is called in the API and after the data has been persisted.
Inheritance
Namespace: Umbraco.Cms.Core.Notifications
Assembly: Umbraco.Core.dll
Syntax
public sealed class ElementSavedNotification : SavedNotification<IElement>, IStatefulNotification, INotification
Constructors
View SourceElementSavedNotification(IEnumerable<IElement>, EventMessages)
Gets a enumeration of IElement.
Declaration
public ElementSavedNotification(IEnumerable<IElement> target, EventMessages messages)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IElement> | target | |
| EventMessages | messages |
ElementSavedNotification(IEnumerable<IElement>, EventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>?)
Initializes a new instance of the ElementSavedNotification class with multiple elements and the cultures that were saved.
Declaration
public ElementSavedNotification(IEnumerable<IElement> target, EventMessages messages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? savedCultures)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IElement> | target | The collection of elements that were saved. |
| EventMessages | messages | The event messages collection. |
| IReadOnlyDictionary<Guid, IReadOnlyCollection<string>> | savedCultures | The cultures that were saved, keyed by element Key. |
ElementSavedNotification(IElement, EventMessages)
Initializes a new instance of the ElementSavedNotification
Declaration
public ElementSavedNotification(IElement target, EventMessages messages)
Parameters
| Type | Name | Description |
|---|---|---|
| IElement | target | |
| EventMessages | messages |
ElementSavedNotification(IElement, EventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>?)
Initializes a new instance of the ElementSavedNotification class with a single element and the cultures that were saved.
Declaration
public ElementSavedNotification(IElement target, EventMessages messages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? savedCultures)
Parameters
| Type | Name | Description |
|---|---|---|
| IElement | target | The element that was saved. |
| EventMessages | messages | The event messages collection. |
| IReadOnlyDictionary<Guid, IReadOnlyCollection<string>> | savedCultures | The cultures that were saved, keyed by element Key. |
Properties
View SourceSavedCultures
Gets the cultures that were saved for each element, keyed by element 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 element. A save that changes nothing for a given element therefore reports no cultures for it. Contrast with PublishedCultures, which reports every culture explicitly published regardless of whether its data changed.
For variant elements the value is the set of cultures whose data changed; for invariant elements it is the
["*"] marker, reported only when the element actually changed. A given element is absent from the
dictionary when no change was tracked for it — e.g. a no-op re-save.
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.