| | | 1 | | using Elsa.Mediator.Contracts; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Mediator.Middleware.Notification; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Represents a context for a notification. |
| | | 7 | | /// </summary> |
| | | 8 | | public class NotificationContext |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Initializes a new instance of the <see cref="NotificationContext"/> class. |
| | | 12 | | /// </summary> |
| | | 13 | | /// <param name="notification">The notification to publish.</param> |
| | | 14 | | /// <param name="notificationStrategy">The publishing strategy to use.</param> |
| | | 15 | | /// <param name="serviceProvider">The service provider to resolve services from.</param> |
| | | 16 | | /// <param name="cancellationToken">The cancellation token.</param> |
| | 11316 | 17 | | public NotificationContext(INotification notification, IEventPublishingStrategy notificationStrategy, IServiceProvid |
| | | 18 | | { |
| | 11316 | 19 | | Notification = notification; |
| | 11316 | 20 | | NotificationStrategy = notificationStrategy; |
| | 11316 | 21 | | ServiceProvider = serviceProvider; |
| | 11316 | 22 | | CancellationToken = cancellationToken; |
| | 11316 | 23 | | } |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// Gets the notification to publish. |
| | | 27 | | /// </summary> |
| | 46681 | 28 | | public INotification Notification { get; init; } |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// Gets the publishing strategy to use. |
| | | 32 | | /// </summary> |
| | 22632 | 33 | | public IEventPublishingStrategy NotificationStrategy { get; init; } |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// Gets the service provider used for resolving dependencies within the notification context. |
| | | 37 | | /// </summary> |
| | 11316 | 38 | | public IServiceProvider ServiceProvider { get; } |
| | | 39 | | |
| | | 40 | | /// <summary> |
| | | 41 | | /// Gets the cancellation token. |
| | | 42 | | /// </summary> |
| | 35365 | 43 | | public CancellationToken CancellationToken { get; init; } |
| | | 44 | | } |