I found the answer in the Entity Framework 6 documentation:
With the introduction of EF6, Microsoft recommends using new API methods: Database.BeginTransaction() and Database.UseTransaction() . Although System.Transactions.TransactionScope is still very well supported, for most EF6 users it is no longer needed. .
While Database.BeginTransaction() used only for database transaction transactions, System.Transactions.TransactionScope , in addition to this, makes it possible for "simple C # code" to also be transactional.
Therefore, use Database.BeginTransaction() , where ever only operations related to db were performed in a transaction in EF6, otherwise use System.Transactions.TransactionScope to mix db operations and C # code together in a transaction.
For those who still prefer the TransactionScope approach, we recommend checking its limitations, especially in cloud scenarios (cloud scripts do not support distributed transactions).
Further information can be found here.
Flair Mar 14 '14 at 13:17 2014-03-14 13:17
source share