Suppose the code has the following structure:
using (var tran = new TransactionScope()) { int i = 0; foreach (var val in col) { i++; if (i == 10) { i = 0; tran.Complete(); } //Какие-то действия с бд } } On msdn it says that Complete can be called once. Is it possible to come up with something that, using 1 TransactionScope perform several commits.
In other words, I want every 10 iterations of the loop to be like 1 transaction.