Class RelateOnTrashNotificationHandler
Handles notifications triggered when content is moved to the recycle bin ("trash") in Umbraco, and manages the relationships between the trashed content and other entities accordingly.
Inheritance
Namespace: Umbraco.Cms.Core.Events
Assembly: Umbraco.Infrastructure.dll
Syntax
public sealed class RelateOnTrashNotificationHandler : INotificationHandler<ContentMovedNotification>, INotificationAsyncHandler<ContentMovedToRecycleBinNotification>, INotificationHandler<MediaMovedNotification>, INotificationAsyncHandler<MediaMovedToRecycleBinNotification>, INotificationHandler<ElementMovedNotification>, INotificationAsyncHandler<ElementMovedToRecycleBinNotification>, INotificationHandler<EntityContainerMovedNotification>, INotificationAsyncHandler<EntityContainerMovedToRecycleBinNotification>, INotificationHandler
Constructors
View SourceRelateOnTrashNotificationHandler(IRelationService, IEntityService, ICoreScopeProvider)
Initializes a new instance of the RelateOnTrashNotificationHandler class.
Declaration
public RelateOnTrashNotificationHandler(IRelationService relationService, IEntityService entityService, ICoreScopeProvider scopeProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| IRelationService | relationService | Service used to manage relations between entities. |
| IEntityService | entityService | Service used to manage entities within Umbraco. |
| ICoreScopeProvider | scopeProvider | Provider for managing database scopes. |
RelateOnTrashNotificationHandler(IRelationService, IEntityService, ICoreScopeProvider, ILocalizedTextService, IAuditService, IScopeProvider, IBackOfficeSecurityAccessor, IUserIdKeyResolver)
Declaration
[Obsolete("Use the non-obsolete constructor instead. Scheduled for removal in Umbraco 19.")]
public RelateOnTrashNotificationHandler(IRelationService relationService, IEntityService entityService, ICoreScopeProvider coreScopeProvider, ILocalizedTextService textService, IAuditService auditService, IScopeProvider scopeProvider, IBackOfficeSecurityAccessor backOfficeSecurityAccessor, IUserIdKeyResolver userIdKeyResolver)
Parameters
| Type | Name | Description |
|---|---|---|
| IRelationService | relationService | |
| IEntityService | entityService | |
| ICoreScopeProvider | coreScopeProvider | |
| ILocalizedTextService | textService | |
| IAuditService | auditService | |
| IScopeProvider | scopeProvider | |
| IBackOfficeSecurityAccessor | backOfficeSecurityAccessor | |
| IUserIdKeyResolver | userIdKeyResolver |
RelateOnTrashNotificationHandler(IRelationService, IEntityService, ILocalizedTextService, IAuditService, IScopeProvider, IBackOfficeSecurityAccessor)
Initializes a new instance of the RelateOnTrashNotificationHandler class. Handles the creation of relations when entities are moved to the recycle bin (trashed).
Declaration
[Obsolete("Use the non-obsolete constructor instead. Scheduled for removal in Umbraco 19.")]
public RelateOnTrashNotificationHandler(IRelationService relationService, IEntityService entityService, ILocalizedTextService textService, IAuditService auditService, IScopeProvider scopeProvider, IBackOfficeSecurityAccessor backOfficeSecurityAccessor)
Parameters
| Type | Name | Description |
|---|---|---|
| IRelationService | relationService | Service used to manage relations between entities. |
| IEntityService | entityService | Service for accessing and managing entities. |
| ILocalizedTextService | textService | Service for retrieving localized text strings. |
| IAuditService | auditService | Service for logging audit events. |
| IScopeProvider | scopeProvider | Provides scope management for database operations. |
| IBackOfficeSecurityAccessor | backOfficeSecurityAccessor | Accessor for back office security context. |
RelateOnTrashNotificationHandler(IRelationService, IEntityService, ILocalizedTextService, IAuditService, IScopeProvider, IBackOfficeSecurityAccessor, IUserIdKeyResolver)
Declaration
[Obsolete("Use the non-obsolete constructor instead. Scheduled for removal in Umbraco 19.")]
public RelateOnTrashNotificationHandler(IRelationService relationService, IEntityService entityService, ILocalizedTextService textService, IAuditService auditService, IScopeProvider scopeProvider, IBackOfficeSecurityAccessor backOfficeSecurityAccessor, IUserIdKeyResolver userIdKeyResolver)
Parameters
| Type | Name | Description |
|---|---|---|
| IRelationService | relationService | |
| IEntityService | entityService | |
| ILocalizedTextService | textService | |
| IAuditService | auditService | |
| IScopeProvider | scopeProvider | |
| IBackOfficeSecurityAccessor | backOfficeSecurityAccessor | |
| IUserIdKeyResolver | userIdKeyResolver |
Methods
View SourceHandle(ContentMovedNotification)
Handles a notification.
Declaration
public void Handle(ContentMovedNotification notification)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentMovedNotification | notification | The notification. |
Handle(ElementMovedNotification)
Handles a notification.
Declaration
public void Handle(ElementMovedNotification notification)
Parameters
| Type | Name | Description |
|---|---|---|
| ElementMovedNotification | notification | The notification. |
Handle(EntityContainerMovedNotification)
Handles a notification.
Declaration
public void Handle(EntityContainerMovedNotification notification)
Parameters
| Type | Name | Description |
|---|---|---|
| EntityContainerMovedNotification | notification | The notification. |
Handle(MediaMovedNotification)
Handles a notification.
Declaration
public void Handle(MediaMovedNotification notification)
Parameters
| Type | Name | Description |
|---|---|---|
| MediaMovedNotification | notification | The notification. |
HandleAsync(ContentMovedToRecycleBinNotification, CancellationToken)
Handles a notification.
Declaration
public Task HandleAsync(ContentMovedToRecycleBinNotification notification, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentMovedToRecycleBinNotification | notification | The notification. |
| CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing the asynchronous operation. |
HandleAsync(ElementMovedToRecycleBinNotification, CancellationToken)
Handles a notification.
Declaration
public Task HandleAsync(ElementMovedToRecycleBinNotification notification, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| ElementMovedToRecycleBinNotification | notification | The notification. |
| CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing the asynchronous operation. |
HandleAsync(EntityContainerMovedToRecycleBinNotification, CancellationToken)
Handles a notification.
Declaration
public Task HandleAsync(EntityContainerMovedToRecycleBinNotification notification, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| EntityContainerMovedToRecycleBinNotification | notification | The notification. |
| CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing the asynchronous operation. |
HandleAsync(MediaMovedToRecycleBinNotification, CancellationToken)
Handles a notification.
Declaration
public Task HandleAsync(MediaMovedToRecycleBinNotification notification, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| MediaMovedToRecycleBinNotification | notification | The notification. |
| CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing the asynchronous operation. |