All Versions
10
Latest Version
Avg Release Cycle
102 days
Latest Release
142 days ago

Changelog History

  • v9.0.0

    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

    June 30, 2020

    ๐Ÿš€ This is a minor release to add support for nullable reference types and target netstandard2.1 (#518).

  • v8.0.1

    February 27, 2020

    ๐Ÿ“š This is a patch release, the package was missing the XML documentation files.

  • v8.0.0

    February 27, 2020

    ๐Ÿ‘€ See announcement:

    ๐Ÿš€ https://jimmybogard.com/mediatr-8-0-released/

  • v7.0.0

    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

    December 10, 2018

    ๐Ÿš€ 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.

  • v5.1.0

    July 30, 2018

    ๐Ÿš€ This release changes the default behavior of awaiting an enumerable of Task. Previous to this release, tasks where awaited using Task.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 virtual PublishCore method, while the other two you can simply replace with your own implementation.

  • v5.0.1

    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 inherits IRequest<Unit>, and the IRequestHandler<T> inherits IRequestHandler<T, Unit>.

    Migration from 4.x to 5.0

  • v5.0.1-alpha

    April 05, 2018

    2018-04-05