Search Results for

    Show / Hide Table of Contents
    View Source

    Class EventAggregatorExtensions

    Extension methods for IEventAggregator.

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.Events
    Assembly: Umbraco.Core.dll
    Syntax
    public static class EventAggregatorExtensions

    Methods

    View Source

    Publish<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.

    View Source

    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.

    View Source

    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.

    View Source

    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.

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • Publish<TNotification>(IEventAggregator, IEnumerable<TNotification>)
      • Publish<TNotification, TNotificationHandler>(IEventAggregator, TNotification)
      • PublishAsync<TNotification>(IEventAggregator, IEnumerable<TNotification>, CancellationToken)
      • PublishAsync<TNotification, TNotificationHandler>(IEventAggregator, TNotification, CancellationToken)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX