Reputation: 5941
Hi I noticed that if I use two edmx , and each one has it's own connection string, but they point to the same database, and server, user and password is the same, then distributed transaction is created. Is it any way to avoid it ?
Upvotes: 1
Views: 85
Reputation: 65870
You have to tell EF
about the single Database connection
. You can do it simply by openning
the connection yourself after creating the context
.
Like this :
using (var ctx = new YourEntities())
{
((IObjectContextAdapter)ctx).ObjectContext.Connection.Open();
//your other code
}
Upvotes: 1