Class ContentUnpublishedNotification
Notification that is published after content has been unpublished.
Inheritance
Namespace: Umbraco.Cms.Core.Notifications
Assembly: Umbraco.Core.dll
Syntax
public sealed class ContentUnpublishedNotification : EnumerableObjectNotification<IContent>, IStatefulNotification, INotification
Remarks
This notification is published by the IContentService after content has been removed from the public site. It is not cancelable since the unpublish operation has already completed.
Constructors
View SourceContentUnpublishedNotification(IEnumerable<IContent>, EventMessages)
Initializes a new instance of the ContentUnpublishedNotification class with multiple content items.
Declaration
public ContentUnpublishedNotification(IEnumerable<IContent> target, EventMessages messages)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IContent> | target | The collection of content items that were unpublished. |
| EventMessages | messages | The event messages collection. |
ContentUnpublishedNotification(IEnumerable<IContent>, EventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>?)
Initializes a new instance of the ContentUnpublishedNotification class with multiple content items and the cultures that were unpublished.
Declaration
public ContentUnpublishedNotification(IEnumerable<IContent> target, EventMessages messages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? unpublishedCultures)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IContent> | target | The collection of content items that were unpublished. |
| EventMessages | messages | The event messages collection. |
| IReadOnlyDictionary<Guid, IReadOnlyCollection<string>> | unpublishedCultures | The cultures that were unpublished, keyed by content Key. |
ContentUnpublishedNotification(IContent, EventMessages)
Initializes a new instance of the ContentUnpublishedNotification class with a single content item.
Declaration
public ContentUnpublishedNotification(IContent target, EventMessages messages)
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | target | The content item that was unpublished. |
| EventMessages | messages | The event messages collection. |
ContentUnpublishedNotification(IContent, EventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>?)
Initializes a new instance of the ContentUnpublishedNotification class with a single content item and the cultures that were unpublished.
Declaration
public ContentUnpublishedNotification(IContent target, EventMessages messages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? unpublishedCultures)
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | target | The content item that was unpublished. |
| EventMessages | messages | The event messages collection. |
| IReadOnlyDictionary<Guid, IReadOnlyCollection<string>> | unpublishedCultures | The cultures that were unpublished, keyed by content Key. |
Properties
View SourceUnpublishedCultures
Gets the cultures that were unpublished for each content item, keyed by content Key.
Declaration
public IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? UnpublishedCultures { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<Guid, IReadOnlyCollection<string>> |
Remarks
This notification is only raised when a document is unpublished as a whole; the value therefore
reports every culture that was taken down (for invariant content, ["*"]). Unpublishing an individual
culture of a still-published variant document does not raise this notification — it is reported on
UnpublishedCultures instead, because that operation is performed
as a publish.
Populated at raise-time (change tracking on the entity is reset once persisted, so it cannot be recovered
from UnpublishedEntities afterwards). The dictionary is null only when the notification
was raised without culture information (for example via a constructor overload that does not accept it).
UnpublishedEntities
Gets the collection of IContent items that were unpublished.
Declaration
public IEnumerable<IContent> UnpublishedEntities { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IContent> |