github jbogard/MediatR v6.0.0
6.0.0

latest releases: v12.2.0, v12.1.1, v12.1.0...
5 years ago

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.

Don't miss a new MediatR release

NewReleases is sending notifications on new releases.