OrangeLoop.Sagas
1.0.9
See the version list below for details.
dotnet add package OrangeLoop.Sagas --version 1.0.9
NuGet\Install-Package OrangeLoop.Sagas -Version 1.0.9
<PackageReference Include="OrangeLoop.Sagas" Version="1.0.9" />
paket add OrangeLoop.Sagas --version 1.0.9
#r "nuget: OrangeLoop.Sagas, 1.0.9"
// Install OrangeLoop.Sagas as a Cake Addin #addin nuget:?package=OrangeLoop.Sagas&version=1.0.9 // Install OrangeLoop.Sagas as a Cake Tool #tool nuget:?package=OrangeLoop.Sagas&version=1.0.9
View full documentation and examples on github.
Summary
Often, our business processes are spread across multiple services and repositories. When a customer completes an order, for example, we need to update the status of the payment and the order in the database. This simple scenario could involve our PaymentsRepository
and our OrdersRepository
, and must fail or succeed together. If an exception occurs while updating the order status in the database, we would need to rollback any changes we made to the payment status as well.
In this example, we assume our business process executes in the same process (e.g. Web Request), and that the operations which must all succeed or fail together involve the database. The traditional way to handle this is to wrap our queries in an IDbTransaction
, and rollback the transaction if there is an exception. The challenge with using the IDbTransaction
directly is that our Order related query and our Payment related query must be grouped together. This doesn't work when using the Repository Pattern, and injecting repositories into our services.
The Unit of Work pattern creates an abstraction of an IDbTransaction, and allows us to define a "Unit of Work" in our Services, rather than in our Repositories.
What about cross-domain business processes? If we have an Orders
microservice, and a Payments
microservice, we must make a call to each in order to update the Order
and Payment
statuses. The queries for each service are executing in separate processes, and using an IDbTransaction
is no longer an option. Sagas to the rescue. A Saga defines a set of steps that must all succeed or fail together, and allows us to explicitly define the rollback process for each step.
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 | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. 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.0
- Microsoft.Extensions.Configuration (>= 2.2.0)
- Microsoft.Extensions.Configuration.FileExtensions (>= 2.2.0)
- Microsoft.Extensions.Configuration.Json (>= 2.2.0)
- System.Configuration.ConfigurationManager (>= 4.5.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.