Releases: LuckyPennySoftware/MediatR
v12.0.0
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
- @sunero4 made their first contribution in #801
- @maniglia made their first contribution in #821
- @darjanbogdan made their first contribution in #830
Migration Guide
Full Changelog: v11.1.0...v12.0.0
v11.1.0
What's Changed
- chore: fix typos by @lucianodelucchi in #777
- Adding type forwardings for types that were moved to the Contracts package by @ydie22 in #800
New Contributors
- @lucianodelucchi made their first contribution in #777
- @ydie22 made their first contribution in #800
Full Changelog: v11.0.0...v11.1.0
v11.0.0
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
- @NRKirby made their first contribution in #740
- @alexandruchirita4192 made their first contribution in #742
- @rafaelsc made their first contribution in #748
- @mjalil made their first contribution in #739
- @FDUdannychen made their first contribution in #767
- @panosru made their first contribution in #772
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.0.0
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
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
8.0.1
8.0.0
See announcement: