Class EventAggregatorExtensions
Extension methods for IEventAggregator.
Inheritance
Namespace: Umbraco.Cms.Core.Events
Assembly: Umbraco.Core.dll
Syntax
public static class EventAggregatorExtensions
Methods
View SourcePublish<TNotification>(IEventAggregator, IEnumerable<TNotification>)
Synchronously send a notifications to multiple handlers of both sync and async.
Declaration
public static void Publish<TNotification>(this IEventAggregator eventAggregator, IEnumerable<TNotification> notifications)
where TNotification : INotification
Parameters
| Type | Name | Description |
|---|---|---|
| IEventAggregator | eventAggregator | The event aggregator. |
| IEnumerable<TNotification> | notifications | The notification objects. |
Type Parameters
| Name | Description |
|---|---|
| TNotification | The type of notification being handled. |
Publish<TNotification, TNotificationHandler>(IEventAggregator, TNotification)
Synchronously send a notifications to multiple handlers of both sync and async.
Declaration
public static void Publish<TNotification, TNotificationHandler>(this IEventAggregator eventAggregator, TNotification notification)
where TNotification : INotification where TNotificationHandler : INotificationHandler
Parameters
| Type | Name | Description |
|---|---|---|
| IEventAggregator | eventAggregator | The event aggregator. |
| TNotification | notification | The notification. |
Type Parameters
| Name | Description |
|---|---|
| TNotification | The type of notification being handled. |
| TNotificationHandler | The type of the notification handler. |
PublishAsync<TNotification>(IEventAggregator, IEnumerable<TNotification>, CancellationToken)
Asynchronously send a notification to multiple handlers of both sync and async.
Declaration
public static Task PublishAsync<TNotification>(this IEventAggregator eventAggregator, IEnumerable<TNotification> notifications, CancellationToken cancellationToken = null)
where TNotification : INotification
Parameters
| Type | Name | Description |
|---|---|---|
| IEventAggregator | eventAggregator | The event aggregator. |
| IEnumerable<TNotification> | notifications | The notifications. |
| CancellationToken | cancellationToken | An optional cancellation token. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the publish operation. |
Type Parameters
| Name | Description |
|---|---|
| TNotification | The type of notification being handled. |
PublishAsync<TNotification, TNotificationHandler>(IEventAggregator, TNotification, CancellationToken)
Asynchronously send a notification to multiple handlers of both sync and async.
Declaration
public static Task PublishAsync<TNotification, TNotificationHandler>(this IEventAggregator eventAggregator, TNotification notification, CancellationToken cancellationToken = null)
where TNotification : INotification where TNotificationHandler : INotificationHandler
Parameters
| Type | Name | Description |
|---|---|---|
| IEventAggregator | eventAggregator | The event aggregator. |
| TNotification | notification | The notification object. |
| CancellationToken | cancellationToken | An optional cancellation token. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the publish operation. |
Type Parameters
| Name | Description |
|---|---|
| TNotification | The type of notification being handled. |
| TNotificationHandler | The type of the notification handler. |