| | | 1 | | using Elsa.Labels.Contracts; |
| | | 2 | | using Elsa.Mediator.Contracts; |
| | | 3 | | using Elsa.Workflows.Management.Notifications; |
| | | 4 | | |
| | | 5 | | namespace Elsa.Labels.Handlers; |
| | | 6 | | |
| | | 7 | | // ReSharper disable once UnusedType.Global |
| | | 8 | | /// <summary> |
| | | 9 | | /// A handler that removes associated workflow labels in response to workflow definitions being deleted. |
| | | 10 | | /// </summary> |
| | | 11 | | public class DeleteWorkflowLabels : INotificationHandler<WorkflowDefinitionDeleted>, INotificationHandler<WorkflowDefini |
| | | 12 | | { |
| | | 13 | | private readonly IWorkflowDefinitionLabelStore _workflowDefinitionLabelStore; |
| | 0 | 14 | | public DeleteWorkflowLabels(IWorkflowDefinitionLabelStore workflowDefinitionLabelStore) => _workflowDefinitionLabelS |
| | | 15 | | |
| | | 16 | | public async Task HandleAsync(WorkflowDefinitionDeleted notification, CancellationToken cancellationToken) => |
| | 0 | 17 | | await _workflowDefinitionLabelStore.DeleteByWorkflowDefinitionIdAsync(notification.DefinitionId, cancellationTok |
| | | 18 | | |
| | | 19 | | public async Task HandleAsync(WorkflowDefinitionsDeleted notification, CancellationToken cancellationToken) => |
| | 0 | 20 | | await _workflowDefinitionLabelStore.DeleteByWorkflowDefinitionIdsAsync(notification.DefinitionIds, cancellationT |
| | | 21 | | } |