MediatR.Extensions.UnitOfWork
8.0.3
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package MediatR.Extensions.UnitOfWork --version 8.0.3
NuGet\Install-Package MediatR.Extensions.UnitOfWork -Version 8.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MediatR.Extensions.UnitOfWork" Version="8.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MediatR.Extensions.UnitOfWork --version 8.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MediatR.Extensions.UnitOfWork, 8.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MediatR.Extensions.UnitOfWork as a Cake Addin #addin nuget:?package=MediatR.Extensions.UnitOfWork&version=8.0.3 // Install MediatR.Extensions.UnitOfWork as a Cake Tool #tool nuget:?package=MediatR.Extensions.UnitOfWork&version=8.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 a 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.
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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.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.