Click here to Skip to main content
15,884,628 members
Articles / Programming Languages / SQL

EF Core Contexts Sharing Transaction

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
26 Nov 2022CPOL6 min read 10.5K   7  
How to share a transaction across multiple Entity Framework contexts
EF Core's DbContext usually manages its own database connection. Because of this, we cannot easily have two contexts participating in a single transaction. We'll see how to share a connection over contexts and how to have them participate in a same transaction.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect AREBIS
Belgium Belgium
Senior Software Architect and independent consultant.

Comments and Discussions