Skip to content

Releases: LuckyPennySoftware/MediatR

v12.0.0

14 Feb 20:58
ba9d3ee

Choose a tag to compare

What's Changed

  • Added static modifier for lambdas where applicable in Mediatr project. by @sunero4 in #801
  • Using MS.Extensions.DI directly, removing all unneeded code, pulling in the MediatR package directly by @jbogard in #802
  • Fixing samples by @jbogard in #807
  • Added target framework to netstandard2.0 by @maniglia in #821
  • Consolidate registration to single configuration object and optimize registration by @jbogard in #828
  • Change type constraint of pipeline behavior to allow easier chaining by @darjanbogdan in #830
  • Scaling back generic constraints by @jbogard in #834
  • Changing IRequest to just be a normal Task instead of Task by @jbogard in #835
  • Adding notification publisher strategies by @jbogard in #838

New Contributors

Migration Guide
Full Changelog: v11.1.0...v12.0.0

v11.1.0

20 Nov 00:32
d2f166e

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v11.0.0...v11.1.0

v11.0.0

30 Sep 09:12

Choose a tag to compare

What's Changed

  • Small grammatical change by @NRKirby in #740
  • Fix "The Castle Windsor Implementation doesn't work with exception handlers #741" issue by @alexandruchirita4192 in #742
  • Improve Test Code Coverage by @rafaelsc in #748
  • MediatR.Examples.Windsor fix bug created by me before by @alexandruchirita4192 in #744
  • Fixed documentation comment of RequestExceptionActionProcessorBehavior by @mjalil in #739
  • Each matching exception handler/action is invoked at most once by @FDUdannychen in #767
  • Switching to ubuntu by @jbogard in #712
  • CA1068: CancellationToken parameters must come last by @panosru in #772

New Contributors

Full Changelog: v10.0.1...v11.0.0
Migration Guide: https://github.com/jbogard/MediatR/wiki/Migration-Guide-10.x-to-11.0

10.0.1

10 Jan 14:29

Choose a tag to compare

This is a patch release to support the latest Contracts package, which changed its targets to netstandard2.0 and net461.

Although MediatR supports only netstandard2.1 and above, it should not force the consumers of the contracts as such.

10.0.0

06 Jan 17:51

Choose a tag to compare

This release adds support for IAsyncEnumerable<T>. A new request type, IStreamRequest<T> represents a request to create a stream, with a new handler type IStreamRequestHandler<TRequest, TResponse> to handle. An example:

public class StreamPing : IStreamRequest<Pong>
{
    public string? Message { get; init; }
}

public class PingStreamHandler : IStreamRequestHandler<StreamPing, Pong>
{
    public async IAsyncEnumerable<Pong> Handle(StreamPing request, 
        [EnumeratorCancellation] CancellationToken cancellationToken)
    {
        yield return await Task.Run(() => new Pong { Message = request.Message + " Pang" }, cancellationToken);
    }
}

Where the work inside of the handler would likely be calling some other streaming API, such as gRPC, EF Core streaming support, Dapper streaming etc.

There are also separate behaviors, with IStreamPipelineBehavior that are separate from the normal IPipelineBehavior.

With the addition of IAsyncEnumerable, this release now targets netstandard2.1 exclusively.

There are some breaking API changes, called out in the 10.0 migration guide.

9.0.0

09 Oct 12:58
365672f

Choose a tag to compare

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.

8.0.2

30 Jun 15:39

Choose a tag to compare

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

8.0.1

27 Feb 16:49

Choose a tag to compare

This is a patch release, the package was missing the XML documentation files.

8.0.0

27 Feb 16:49
4f87648

Choose a tag to compare

7.0.0

30 Apr 17:57
8e0c349

Choose a tag to compare

This release includes a small, but breaking change. Request post-processors now include the cancellation token:

Task Process(TRequest request, TResponse response, CancellationToken cancellationToken);