Skip to content

Upgrading MediatR 5 to 6

Breaking5.1.0 → 6.0.0Breaking2Changed2

BreakingUpgrade verdict

2 breaking changes.

  • The mediator interface gains a new Publish method that accepts any object as a notification, not just typed notifications.
  • If you subclassed Mediator and overrode PublishCore, its parameter type has changed, so your override must be updated.
2 items need code or config changes

Target frameworks requirement changed in 6.0.0: .NETFramework4.5, .NETStandard1.3, .NETStandard2.0 → .NETFramework4.6.1, .NETStandard2.0.

Breaking2
Adds a non-generic Publish(object, CancellationToken) overload to IMediator.
IMediatorIMediator.Publish(object, CancellationToken)IMediator.Publish<TNotification>(TNotification, CancellationToken)
Changes PublishCore to take IEnumerable<Func<Task>> instead of IEnumerable<Task>.
Mediator.PublishCore(IEnumerable<Func<Task>>)