Reyrb.Database.Transactions 10.0.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Reyrb.Database.Transactions --version 10.0.0
                    
NuGet\Install-Package Reyrb.Database.Transactions -Version 10.0.0
                    
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="Reyrb.Database.Transactions" Version="10.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Reyrb.Database.Transactions" Version="10.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Reyrb.Database.Transactions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Reyrb.Database.Transactions --version 10.0.0
                    
#r "nuget: Reyrb.Database.Transactions, 10.0.0"
                    
#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.
#:package Reyrb.Database.Transactions@10.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Reyrb.Database.Transactions&version=10.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Reyrb.Database.Transactions&version=10.0.0
                    
Install as a Cake Tool

Reyrb.Database.Transactions

Requires .NET 10 and EF Core 10.

await using var transaction = await context.BeginOrJoinTransactionAsync();
// Make changes using context.
await context.SaveChangesAsync();
await transaction.CompleteAsync();

Auto joins the context's existing EF transaction or the ambient transaction, if present. Otherwise it starts an EF transaction. An explicit TransactionMethod requires a compatible existing transaction or creates one using that mechanism.

The isolation level applies only when creating a transaction. Joining accepts the existing isolation level, regardless of the requested value.

Only an owning handle controls the transaction. Completing or disposing a joined handle has no effect on the outer transaction. Joining creates no savepoint and does not prevent an outer commit after a caught inner exception. The owner decides whether to commit or roll back.

An owned EF transaction commits in CompleteAsync. An owned TransactionScope is marked complete by CompleteAsync and commits on disposal. Disposing either without completing rolls back. CompleteAsync does not call SaveChangesAsync.

Ambient transactions

await using var transaction = await context.BeginOrJoinTransactionAsync(
    TransactionMethod.TransactionScope);
await context.SaveChangesAsync();
await transaction.CompleteAsync();

Call the factory directly from the method that uses and disposes the scope. Do not wrap it in another async factory that returns the handle: execution context changes made inside an async method do not flow back to its caller. The factory intentionally has no async modifier; only the EF creation helper awaits internally. The ambient transaction flows across awaits in the calling method. Dispose handles in reverse creation order, as with ordinary TransactionScope.

The provider must support System.Transactions. await using forwards asynchronous disposal to EF transactions. Transaction scopes dispose synchronously, even through DisposeAsync, because TransactionScope has no asynchronous commit or disposal API. New scopes use TransactionManager.DefaultTimeout.

API changes

IDbTransaction now also implements IAsyncDisposable. If you implement this interface, provide DisposeAsync. Both public wrapper constructors now require a non-null transaction; use BeginOrJoinTransactionAsync to obtain a joined handle. Argument and transaction-method validation failures are thrown synchronously by the factory.

Run the transaction tests with:

dotnet test Reyrb.Database.Transactions.Tests --configuration Release
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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