Table of Contents

Class EventHandlerEnumerableExtensions

Namespace
CMS.Base
Assembly
CMS.Base.dll

Contains extension methods for IAsyncEventHandler<TAsyncEvent> invocation.

public static class EventHandlerEnumerableExtensions
Inheritance
object
EventHandlerEnumerableExtensions

Methods

InvokeAsync<TAsyncEvent>(IEnumerable<IAsyncEventHandler<TAsyncEvent>>, TAsyncEvent, CancellationToken)

Invokes the HandleAsync(TAsyncEvent, CancellationToken) method on all handlers.

public static Task InvokeAsync<TAsyncEvent>(this IEnumerable<IAsyncEventHandler<TAsyncEvent>> handlers, TAsyncEvent asyncEvent, CancellationToken cancellationToken) where TAsyncEvent : IAsyncEvent

Parameters

handlers IEnumerable<IAsyncEventHandler<TAsyncEvent>>

Enumeration of handlers whose HandleAsync(TAsyncEvent, CancellationToken) method to invoke.

asyncEvent TAsyncEvent

Asynchronous event passed to the handlers.

cancellationToken CancellationToken

The cancellation instruction.

Returns

Task

Returns a task representing the asynchronous invocation operation.

Type Parameters

TAsyncEvent

Type of the asynchronous event being handled.

Exceptions

ArgumentNullException

Thrown when handlers is null.

See Also