|
16 | 16 | using System.Diagnostics; |
17 | 17 | using System.Globalization; |
18 | 18 | using System.IO; |
| 19 | +using System.Linq; |
19 | 20 | using System.Runtime.Serialization; |
20 | 21 | using System.Runtime.Serialization.Formatters.Binary; |
21 | 22 | using System.Text; |
@@ -1222,10 +1223,7 @@ public async Task BatchLoadAsync() |
1222 | 1223 | await (s.DeleteAsync(baz2)); |
1223 | 1224 | await (s.DeleteAsync(baz3)); |
1224 | 1225 |
|
1225 | | - IEnumerable en = new JoinedEnumerable( |
1226 | | - new IEnumerable[] {baz.FooSet, baz2.FooSet}); |
1227 | | - |
1228 | | - foreach (object obj in en) |
| 1226 | + foreach (var obj in baz.FooSet.Concat(baz2.FooSet)) |
1229 | 1227 | { |
1230 | 1228 | await (s.DeleteAsync(obj)); |
1231 | 1229 | } |
@@ -5273,16 +5271,13 @@ public async Task TransientOrphanDeleteAsync() |
5273 | 5271 | Baz baz = new Baz(); |
5274 | 5272 | var bars = new HashSet<BarProxy> { new Bar(), new Bar(), new Bar() }; |
5275 | 5273 | baz.CascadingBars = bars; |
5276 | | - IList<Foo> foos = new List<Foo>(); |
5277 | | - foos.Add(new Foo()); |
5278 | | - foos.Add(new Foo()); |
| 5274 | + var foos = new List<Foo> { new Foo(), new Foo() }; |
5279 | 5275 | baz.FooBag = foos; |
5280 | 5276 | await (s.SaveAsync(baz)); |
5281 | 5277 |
|
5282 | | - IEnumerator enumer = new JoinedEnumerable(new IEnumerable[] {foos, bars}).GetEnumerator(); |
5283 | | - while (enumer.MoveNext()) |
| 5278 | + foreach (var foo in foos.Concat(bars.Cast<FooProxy>())) |
5284 | 5279 | { |
5285 | | - FooComponent cmp = ((Foo) enumer.Current).Component; |
| 5280 | + var cmp = foo.Component; |
5286 | 5281 | await (s.DeleteAsync(cmp.Glarch)); |
5287 | 5282 | cmp.Glarch = null; |
5288 | 5283 | } |
|
0 commit comments