Changelog History
-
v9.0.0 Changes
October 09, 2020๐ This release contains a small, but breaking change. In order to provide a simpler interface, the
IMediator
interface is now split into two interfaces, a sender and publisher:public interface ISender{ Task\<TResponse\> Send\<TResponse\>(IRequest\<TResponse\> request, CancellationToken cancellationToken = default); Task\<object?\> Send(object request, CancellationToken cancellationToken = default); }public interface IPublisher{ Task Publish(object notification, CancellationToken cancellationToken = default); Task Publish\<TNotification\>(TNotification notification, CancellationToken cancellationToken = default) where TNotification : INotification; }public interface IMediator : ISender, IPublisher{ }
The main motivation here is that sending should be a top-level concern of an application, but publishing can happen anywhere. This interface segregation should help catch design errors, where should never send requests from anywhere inside a request handler.
-
v8.1.0
July 27, 2020 -
v8.0.2 Changes
June 30, 2020๐ This is a minor release to add support for nullable reference types and target
netstandard2.1
(#518). -
v8.0.1 Changes
February 27, 2020๐ This is a patch release, the package was missing the XML documentation files.
-
v8.0.0 Changes
February 27, 2020๐ See announcement:
-
v7.0.0 Changes
April 30, 2019๐ This release includes a small, but breaking change. Request post-processors now include the cancellation token:
Task Process(TRequest request, TResponse response, CancellationToken cancellationToken);
-
v6.0.0 Changes
December 10, 2018๐ This release brings a slight breaking change to the
Mediator
class. It adds a non-generic method overload toPublish
: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
andnetstandard2.0
and adds strong-naming to the assembly.net45
andnetstandard1.3
were dropped. -
v5.1.0 Changes
July 30, 2018๐ This release changes the default behavior of awaiting an enumerable of
Task
. Previous to this release, tasks where awaited usingTask.WhenAll
. This causes problems in a variety of environments and situations that expect sequential ordering.๐ In this release, the default behavior for enumerables is to await in a
foreach
, for:Mediator.Publish
RequestPreProcessorBehavior
RequestPostProcessorBehavior
You can override the
Mediator.Publish
behavior by overriding the virtualPublishCore
method, while the other two you can simply replace with your own implementation. -
v5.0.1 Changes
June 05, 2018๐ This release consolidates some interfaces and factories. The factory delegates are now just a single delegate,
ServiceFactory
.โ Additionally, the "void"
IRequest
interface now inheritsIRequest<Unit>
, and theIRequestHandler<T>
inheritsIRequestHandler<T, Unit>
. -
v5.0.1-alpha Changes
April 05, 20182018-04-05