MediatR.Extensions.UnitOfWork
8.0.6
See the version list below for details.
dotnet add package MediatR.Extensions.UnitOfWork --version 8.0.6
NuGet\Install-Package MediatR.Extensions.UnitOfWork -Version 8.0.6
<PackageReference Include="MediatR.Extensions.UnitOfWork" Version="8.0.6" />
paket add MediatR.Extensions.UnitOfWork --version 8.0.6
#r "nuget: MediatR.Extensions.UnitOfWork, 8.0.6"
// Install MediatR.Extensions.UnitOfWork as a Cake Addin #addin nuget:?package=MediatR.Extensions.UnitOfWork&version=8.0.6 // Install MediatR.Extensions.UnitOfWork as a Cake Tool #tool nuget:?package=MediatR.Extensions.UnitOfWork&version=8.0.6
MediatR.Extensions.UnitOfWork
Set of extensions to run multiple MediatR commands sequentially.
Simple sequence of commands
Sequence in a transaction scope,
var command1 = new CreatePurchaseCommand : ICommandResult { WorkerId = userId, }; var command2 = new BurnPurchaseCommand : ICommandResult { WorkerId = userId, }; var result1 = await Mediator.Chain(command1, command2); var result2 = await Mediator.ChainScoped(command1, command2); //OR in transaction to commit or rollback them both
When you need to fire a notification just after a command succeded/failed without any changes in a handler.
Creates a proper contract,
Firing of notification after the command becomes more transparent.
var command3 = new BurnPurchaseAndNotifyCommand : INotificationResult { WorkerId = userId, }; var result1 = await Mediator.SendThenPublish(command1, command2);
This allows to execute multiple commands with notifications, which should fail or succeed simultaniously.
Commands are not nested
And can be executed in a scope
Notifications are executed afterwards, means it becomes transparent
You can update your app, without changes in commands that are already tested.
Each command becomes atomic, and knows only about itself and notifications.
var command3 = new BurnPurchaseAndNotifyCommand : INotificationResult { WorkerId = userId, }; var command4 = new BurnPurchaseAndNotifyCommand : INotificationResult { WorkerId = userId, }; var result1 = await Mediator.RunAllScopedThenPublish(command3, command4); var result2 = await Mediator.RunAllScoped(command3, command4).ThenPublishAll(); var result2 = await Mediator.RunAllScoped(command3, command4).ThenPublishSucceed(); var result3 = await Mediator.RunAllScoped(command3, command4).ThenPublishFailed();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- MediatR (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.