How to implement ambient transaction in Entity Framework Core?
问题 I need to realize transaction under two models (using two separated bounded contexts). So code like this: using (TransactionScope scope = new TransactionScope()) { //Operation 1 using(var context1 = new Context1()) { context1.Add(someCollection1); context1.SaveChanges(); } //Operation 2 using(var context2 = new Context2()) { context2.Add(someCollection2); context2.SaveChanges(); } scope.Complete(); } return the exception: An ambient transaction has been detected. Entity Framework Core does