Reputation: 81
Is there a way to use EF without transaction? I have very simple single insert and don't want to roll-back when something goes wrong as there may be a trigger logging then raising error from the DB side which I have no control over. I just want to insert then catch any exceptions but don't want to roll-back.
Upvotes: 8
Views: 1513
Reputation: 24754
using( var transation = new TransactionScope(TransactionScopeOption.Suppress) )
{
ObjectContext.SaveChanges();
}
Upvotes: 2
Reputation: 121922
We are not aware of any way to get rid of transactions in Entity Framework CUD operations.
Upvotes: 3