Skip to content

6.0.0

Compare
Choose a tag to compare
@jbogard jbogard released this 10 Dec 19:58
· 317 commits to master since this release

This release brings a slight breaking change to the Mediator class. It adds a non-generic method overload to Publish:

public interface IMediator
{
    Task<TResponse> Send<TResponse>(IRequest<TResponse> request, CancellationToken cancellationToken = default);

+    Task Publish(object notification, CancellationToken cancellationToken = default);

    Task Publish<TNotification>(TNotification notification, CancellationToken cancellationToken = default)
        where TNotification : INotification;
}

And expands the publishing possibilities for the Mediator class:

-        protected virtual async Task PublishCore(IEnumerable<Task> allHandlers)
+        protected virtual async Task PublishCore(IEnumerable<Func<Task>> allHandlers)
        {
            foreach (var handler in allHandlers)
            {
-                await handler.ConfigureAwait(false);
+                await handler().ConfigureAwait(false);
            }

If you've overridden the PublishCore method, check out the publishing options section in the wiki for some examples.

This release targets net461 and netstandard2.0 and adds strong-naming to the assembly. net45 and netstandard1.3 were dropped.