MediatR.Extensions.UnitOfWork 8.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package MediatR.Extensions.UnitOfWork --version 8.0.4                
NuGet\Install-Package MediatR.Extensions.UnitOfWork -Version 8.0.4                
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.4" />                
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.4                
#r "nuget: MediatR.Extensions.UnitOfWork, 8.0.4"                
#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.4

// Install MediatR.Extensions.UnitOfWork as a Cake Tool
#tool nuget:?package=MediatR.Extensions.UnitOfWork&version=8.0.4                

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 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

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.8 1,273 2/12/2020
8.0.7 511 2/12/2020
8.0.6 526 2/12/2020
8.0.5 464 2/12/2020
8.0.4 448 2/11/2020
8.0.3 439 2/11/2020
8.0.2 419 2/11/2020
8.0.1 481 2/11/2020
8.0.0 476 2/11/2020