Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docs on ambient transactions #4360

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions entity-framework/core/saving/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ It is also possible to enlist in an explicit transaction.

[!code-csharp[Main](../../../samples/core/Saving/Transactions/CommitableTransaction.cs?name=Transaction&highlight=1-2,15,28-30)]

> [!NOTE]
> If you're using async APIs, be sure to specify [TransactionScopeAsyncFlowOption.Enabled](/dotnet/api/system.transactions.transactionscopeasyncflowoption) in the `TransactionScoped` constructor to ensure that the ambient transaction flows across async calls.

For more information on `TransactionScope` and ambient transactions, [see this documentation](/dotnet/framework/data/transactions/implementing-an-implicit-transaction-using-transaction-scope).

### Limitations of System.Transactions

1. EF Core relies on database providers to implement support for System.Transactions. If a provider does not implement support for System.Transactions, it is possible that calls to these APIs will be completely ignored. SqlClient supports it.
Expand Down