|
1 | 1 | using System;
|
2 | 2 | using System.Collections;
|
3 | 3 | using System.Collections.Generic;
|
4 |
| -using System.Linq; |
5 | 4 | using System.Text;
|
6 | 5 | using System.Threading;
|
7 | 6 | using System.Threading.Tasks;
|
@@ -156,14 +155,13 @@ public void RegisterProcess(AfterTransactionCompletionProcessDelegate process)
|
156 | 155 | RegisterProcess(new AfterTransactionCompletionDelegatedProcess(process));
|
157 | 156 | }
|
158 | 157 |
|
159 |
| - private void ExecuteActions(IList list) |
| 158 | + private void ExecuteActions<T>(List<T> list) where T: IExecutable |
160 | 159 | {
|
161 | 160 | // Actions may raise events to which user code can react and cause changes to action list.
|
162 | 161 | // It will then fail here due to list being modified. (Some previous code was dodging the
|
163 | 162 | // trouble with a for loop which was not failing provided the list was not getting smaller.
|
164 | 163 | // But then it was clearing it without having executed added actions (if any), ...)
|
165 |
| - |
166 |
| - foreach (IExecutable executable in list) |
| 164 | + foreach (var executable in list) |
167 | 165 | {
|
168 | 166 | InnerExecute(executable);
|
169 | 167 | }
|
@@ -258,9 +256,9 @@ public void ExecuteActions()
|
258 | 256 | }
|
259 | 257 | }
|
260 | 258 |
|
261 |
| - private static void PrepareActions(IList queue) |
| 259 | + private static void PrepareActions<T>(List<T> queue) where T: IExecutable |
262 | 260 | {
|
263 |
| - foreach (IExecutable executable in queue) |
| 261 | + foreach (var executable in queue) |
264 | 262 | executable.BeforeExecutions();
|
265 | 263 | }
|
266 | 264 |
|
@@ -329,9 +327,9 @@ public bool AreInsertionsOrDeletionsQueued
|
329 | 327 | get { return (insertions.Count > 0 || deletions.Count > 0); }
|
330 | 328 | }
|
331 | 329 |
|
332 |
| - private static bool AreTablesToUpdated(IList executables, ICollection<string> tablespaces) |
| 330 | + private static bool AreTablesToUpdated<T>(List<T> executables, ISet<string> tablespaces) where T: IExecutable |
333 | 331 | {
|
334 |
| - foreach (IExecutable exec in executables) |
| 332 | + foreach (var exec in executables) |
335 | 333 | {
|
336 | 334 | var spaces = exec.PropertySpaces;
|
337 | 335 | foreach (string o in spaces)
|
|
0 commit comments