This question is locked. New answers and comments are not allowed.
Hi
When working with older versions of Openaccess I often do something like this in data methods:
This way I could either call the method "on its own" or as part of a transaction, along with other such methods,
in which case the transaction was handled in the calling method.
Now with the newer versions, I can't find a way to explicitly start a transaction.
You only call context.SaveChanges() to commit the transaction.
Is there a way I can achieve the old behavior, short of passing along a parameter to indicate whether to commit or not?
When working with older versions of Openaccess I often do something like this in data methods:
bool shouldCommit = !scope.Transaction.IsActive;
if(shouldCommit)
scope.Transaction.Begin();
//Do some stuff
if(shouldCommit)
scope.Transaction.Commit();
This way I could either call the method "on its own" or as part of a transaction, along with other such methods,
in which case the transaction was handled in the calling method.
Now with the newer versions, I can't find a way to explicitly start a transaction.
You only call context.SaveChanges() to commit the transaction.
Is there a way I can achieve the old behavior, short of passing along a parameter to indicate whether to commit or not?