-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TransactionScope for EFUtilities #43
Comments
First of all I would suggest you to actually test that the following works by throwing an exception between the calls and make sure nothing was deleted. I find Transaction support slightly hard to test. Basically you should only need to wrap the whole block in a TransactionScope. See the example here: #26 |
Hi Mikael, |
Hi Mikael, I am able to set the transaction scope for my code now. |
I am using EF.Utilities 0.5.0 in my code and have some query regarding it.
First of all, this is the best package that I have come across for performing bulk operations.
Now about my query, I have a condition in my code where I am trying to delete an entire table (around 24K records) and then add same number of records again.
For deletion, I have added following code:
EFBatchOperation.For(context, context.ArticleImages).Where(x => true).Delete();
And for insertion, I am using following code:
EFBatchOperation.For(context, context.ArticleImages).InsertAll(articleImages);
I am doing this in a single method and passing same context object in both calls.
Now, I want to include these both operations in a single TransactioScope. Please suggest how should I do it?
Thanks in advance.
The text was updated successfully, but these errors were encountered: