annotate UnitTests/Linq/ConcatUnionTest.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
1 using System;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
2 using System.Linq;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
3
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
4 using BLToolkit.Data.DataProvider;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
5 using BLToolkit.Data.Linq;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
6 using BLToolkit.DataAccess;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
7
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
8 using NUnit.Framework;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
9
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
10 namespace Data.Linq
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
11 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
12 using Model;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
13
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
14 [TestFixture]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
15 public class ConcatUnionTest : TestBase
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
16 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
17 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
18 public void Concat1()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
19 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
20 var expected =
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
21 (from p in Parent where p.ParentID == 1 select p).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
22 (from p in Parent where p.ParentID == 2 select p));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
23
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
24 ForEachProvider(db => AreEqual(expected,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
25 (from p in db.Parent where p.ParentID == 1 select p).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
26 (from p in db.Parent where p.ParentID == 2 select p))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
27 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
28
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
29 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
30 public void Concat11()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
31 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
32 ForEachProvider(db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
33 (from ch in Child where ch.ParentID == 1 select ch.Parent).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
34 (from ch in Child where ch.ParentID == 2 select ch.Parent)),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
35 (from ch in db.Child where ch.ParentID == 1 select ch.Parent).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
36 (from ch in db.Child where ch.ParentID == 2 select ch.Parent))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
37 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
38
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
39 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
40 public void Concat12()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
41 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
42 ForEachProvider(db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
43 (from p in Parent where p.ParentID == 1 select p).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
44 (from ch in Child where ch.ParentID == 2 select ch.Parent)),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
45 (from p in db.Parent where p.ParentID == 1 select p).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
46 (from ch in db.Child where ch.ParentID == 2 select ch.Parent))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
47 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
48
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
49 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
50 public void Concat2()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
51 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
52 var expected =
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
53 (from p in Parent where p.ParentID == 1 select p).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
54 (from p in Parent where p.ParentID == 2 select p)).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
55 (from p in Parent where p.ParentID == 4 select p));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
56
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
57 ForEachProvider(db => AreEqual(expected,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
58 (from p in db.Parent where p.ParentID == 1 select p).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
59 (from p in db.Parent where p.ParentID == 2 select p)).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
60 (from p in db.Parent where p.ParentID == 4 select p))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
61 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
62
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
63 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
64 public void Concat3()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
65 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
66 var expected =
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
67 (from p in Parent where p.ParentID == 1 select p).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
68 (from p in Parent where p.ParentID == 2 select p).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
69 (from p in Parent where p.ParentID == 4 select p)));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
70
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
71 ForEachProvider(db => AreEqual(expected,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
72 (from p in db.Parent where p.ParentID == 1 select p).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
73 (from p in db.Parent where p.ParentID == 2 select p).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
74 (from p in db.Parent where p.ParentID == 4 select p)))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
75 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
76
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
77 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
78 public void Concat4()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
79 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
80 var expected =
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
81 (from c in Child where c.ParentID == 1 select c).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
82 (from c in Child where c.ParentID == 3 select new Child { ParentID = c.ParentID, ChildID = c.ChildID + 1000 }).
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
83 Where(c => c.ChildID != 1032));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
84
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
85 ForEachProvider(db => AreEqual(expected,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
86 (from c in db.Child where c.ParentID == 1 select c).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
87 (from c in db.Child where c.ParentID == 3 select new Child { ParentID = c.ParentID, ChildID = c.ChildID + 1000 })).
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
88 Where(c => c.ChildID != 1032)));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
89 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
90
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
91 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
92 public void Concat401()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
93 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
94 var expected =
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
95 (from c in Child where c.ParentID == 1 select c).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
96 (from c in Child where c.ParentID == 3 select new Child { ChildID = c.ChildID + 1000, ParentID = c.ParentID }).
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
97 Where(c => c.ChildID != 1032));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
98
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
99 ForEachProvider(db => AreEqual(expected,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
100 (from c in db.Child where c.ParentID == 1 select c).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
101 (from c in db.Child where c.ParentID == 3 select new Child { ChildID = c.ChildID + 1000, ParentID = c.ParentID })).
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
102 Where(c => c.ChildID != 1032)));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
103 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
104
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
105 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
106 public void Concat5()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
107 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
108 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
109 new[] { ProviderName.DB2, ProviderName.Informix },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
110 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
111 (from c in Child where c.ParentID == 1 select c).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
112 (from c in Child where c.ParentID == 3 select new Child { ChildID = c.ChildID + 1000 }).
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
113 Where(c => c.ChildID != 1032)),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
114 (from c in db.Child where c.ParentID == 1 select c).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
115 (from c in db.Child where c.ParentID == 3 select new Child { ChildID = c.ChildID + 1000 })).
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
116 Where(c => c.ChildID != 1032)));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
117 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
118
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
119 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
120 public void Concat501()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
121 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
122 ForEachProvider(new[] { ProviderName.DB2, ProviderName.Informix },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
123 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
124 (from c in Child where c.ParentID == 1 select new Child { ParentID = c.ParentID }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
125 (from c in Child where c.ParentID == 3 select new Child { ChildID = c.ChildID + 1000 }).
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
126 Where(c => c.ParentID == 1)),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
127 (from c in db.Child where c.ParentID == 1 select new Child { ParentID = c.ParentID }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
128 (from c in db.Child where c.ParentID == 3 select new Child { ChildID = c.ChildID + 1000 })).
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
129 Where(c => c.ParentID == 1)));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
130 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
131
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
132 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
133 public void Concat502()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
134 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
135 ForEachProvider(new[] { ProviderName.DB2, ProviderName.Informix },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
136 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
137 (from c in Child where c.ParentID == 1 select c.Parent).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
138 (from c in Child where c.ParentID == 3 select c.Parent).
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
139 Where(p => p.Value1.Value != 2)),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
140 (from c in db.Child where c.ParentID == 1 select c.Parent).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
141 (from c in db.Child where c.ParentID == 3 select c.Parent)).
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
142 Where(p => p.Value1.Value != 2)));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
143 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
144
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
145 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
146 public void Concat6()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
147 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
148 ForEachProvider(new[] { ProviderName.SqlCe },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
149 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
150 Child.Where(c => c.GrandChildren.Count == 2).Concat( Child.Where(c => c.GrandChildren.Count() == 3)),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
151 db.Child.Where(c => c.GrandChildren.Count == 2).Concat(db.Child.Where(c => c.GrandChildren.Count() == 3))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
152 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
153
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
154 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
155 public void Concat7([IncludeDataContexts("Northwind")] string context)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
156 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
157 using (var db = new NorthwindDB())
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
158 AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
159 Customer.Where(c => c.Orders.Count <= 1).Concat( Customer.Where(c => c.Orders.Count > 1)),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
160 db.Customer.Where(c => c.Orders.Count <= 1).Concat(db.Customer.Where(c => c.Orders.Count > 1)));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
161 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
162
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
163 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
164 public void Concat81()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
165 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
166 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
167 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
168 Parent.Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID, }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
169 Child. Select(c => new { ID1 = c.ParentID, ID2 = c.ChildID, })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
170 db.Parent.Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID, }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
171 db.Child. Select(c => new { ID1 = c.ParentID, ID2 = c.ChildID, }))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
172 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
173
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
174 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
175 public void Concat82()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
176 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
177 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
178 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
179 Child. Select(c => new { ID1 = c.ParentID, ID2 = c.ChildID, }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
180 Parent.Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID, })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
181 db.Child. Select(c => new { ID1 = c.ParentID, ID2 = c.ChildID, }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
182 db.Parent.Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID, }))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
183 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
184
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
185 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
186 public void Concat83()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
187 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
188 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
189 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
190 Parent.Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID, ID3 = c.Value1 ?? 0, }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
191 Child. Select(c => new { ID1 = c.ParentID, ID2 = c.ChildID, ID3 = c.ParentID + 1, })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
192 db.Parent.Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID, ID3 = c.Value1 ?? 0, }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
193 db.Child. Select(c => new { ID1 = c.ParentID, ID2 = c.ChildID, ID3 = c.ParentID + 1, }))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
194 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
195
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
196 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
197 public void Concat84()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
198 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
199 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
200 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
201 Child. Select(c => new { ID1 = c.ParentID, ID2 = c.ChildID, ID3 = c.ParentID + 1, }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
202 Parent.Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID, ID3 = c.Value1 ?? 0, })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
203 db.Child. Select(c => new { ID1 = c.ParentID, ID2 = c.ChildID, ID3 = c.ParentID + 1, }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
204 db.Parent.Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID, ID3 = c.Value1 ?? 0, }))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
205 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
206
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
207 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
208 public void Concat85()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
209 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
210 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
211 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
212 Parent.Select(c => new { ID1 = c.ParentID, ID2 = c.Value1 ?? 0, ID3 = c.ParentID, }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
213 Child. Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID + 1, ID3 = c.ChildID, })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
214 db.Parent.Select(c => new { ID1 = c.ParentID, ID2 = c.Value1 ?? 0, ID3 = c.ParentID, }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
215 db.Child. Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID + 1, ID3 = c.ChildID, }))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
216 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
217
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
218 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
219 public void Concat851()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
220 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
221 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
222 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
223 Parent.Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID, ID3 = c.ParentID, }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
224 Child. Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID + 1, ID3 = c.ChildID, })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
225 db.Parent.Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID, ID3 = c.ParentID, }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
226 db.Child. Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID + 1, ID3 = c.ChildID, }))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
227 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
228
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
229 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
230 public void Concat86()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
231 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
232 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
233 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
234 Child. Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID + 1, ID3 = c.ChildID, }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
235 Parent.Select(c => new { ID1 = c.ParentID, ID2 = c.Value1 ?? 0, ID3 = c.ParentID, })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
236 db.Child. Select(c => new { ID1 = c.ParentID, ID2 = c.ParentID + 1, ID3 = c.ChildID, }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
237 db.Parent.Select(c => new { ID1 = c.ParentID, ID2 = c.Value1 ?? 0, ID3 = c.ParentID, }))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
238 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
239
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
240 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
241 public void Concat87()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
242 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
243 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
244 new[] { ProviderName.Informix },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
245 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
246 Child. Select(c => new Parent { ParentID = c.ParentID }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
247 Parent.Select(c => new Parent { Value1 = c.Value1 })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
248 db.Child. Select(c => new Parent { ParentID = c.ParentID }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
249 db.Parent.Select(c => new Parent { Value1 = c.Value1 }))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
250 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
251
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
252 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
253 public void Concat871()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
254 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
255 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
256 new[] { ProviderName.Informix },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
257 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
258 Parent.Select(c => new Parent { Value1 = c.Value1 }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
259 Child. Select(c => new Parent { ParentID = c.ParentID })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
260 db.Parent.Select(c => new Parent { Value1 = c.Value1 }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
261 db.Child. Select(c => new Parent { ParentID = c.ParentID }))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
262 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
263
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
264 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
265 public void Concat88()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
266 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
267 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
268 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
269 Child. Select(c => new Parent { Value1 = c.ChildID, ParentID = c.ParentID }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
270 Parent.Select(c => new Parent { ParentID = c.ParentID, Value1 = c.Value1 })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
271 db.Child. Select(c => new Parent { Value1 = c.ChildID, ParentID = c.ParentID }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
272 db.Parent.Select(c => new Parent { ParentID = c.ParentID, Value1 = c.Value1 }))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
273 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
274
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
275 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
276 public void Concat89()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
277 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
278 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
279 new[] { ProviderName.Informix },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
280 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
281 Child. Select(c => new Parent { Value1 = c.ParentID, ParentID = c.ParentID }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
282 Parent.Select(c => new Parent { ParentID = c.ParentID })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
283 db.Child. Select(c => new Parent { Value1 = c.ParentID, ParentID = c.ParentID }).Concat(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
284 db.Parent.Select(c => new Parent { ParentID = c.ParentID }))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
285 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
286
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
287 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
288 public void Union1()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
289 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
290 ForEachProvider(db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
291 (from g in GrandChild join ch in Child on g.ChildID equals ch.ChildID select ch).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
292 (from ch in Child join p in Parent on ch.ParentID equals p.ParentID select ch)),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
293 (from g in db.GrandChild join ch in db.Child on g.ChildID equals ch.ChildID select ch).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
294 (from ch in db.Child join p in db.Parent on ch.ParentID equals p.ParentID select ch))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
295 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
296
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
297 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
298 public void Union2()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
299 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
300 ForEachProvider(db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
301 from r in
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
302 (from g in GrandChild join ch in Child on g.ChildID equals ch.ChildID select ch.ChildID).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
303 (from ch in Child join p in Parent on ch.ParentID equals p.ParentID select ch.ChildID))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
304 join child in Child on r equals child.ChildID
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
305 select child,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
306 from r in
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
307 (from g in db.GrandChild join ch in db.Child on g.ChildID equals ch.ChildID select ch.ChildID).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
308 (from ch in db.Child join p in db.Parent on ch.ParentID equals p.ParentID select ch.ChildID))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
309 join child in db.Child on r equals child.ChildID
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
310 select child));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
311 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
312
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
313 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
314 public void Union3()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
315 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
316 ForEachProvider(db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
317 (from p in Parent select new { id = p.ParentID, val = true }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
318 (from ch in Child select new { id = ch.ParentID, val = false })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
319 (from p in db.Parent select new { id = p.ParentID, val = true }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
320 (from ch in db.Child select new { id = ch.ParentID, val = false }))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
321 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
322
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
323 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
324 public void Union4()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
325 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
326 ForEachProvider(db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
327 (from p in Parent select new { id = p.ParentID, val = true }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
328 (from ch in Child select new { id = ch.ParentID, val = false }))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
329 .Select(p => new { p.id, p.val }),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
330 (from p in db.Parent select new { id = p.ParentID, val = true }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
331 (from ch in db.Child select new { id = ch.ParentID, val = false }))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
332 .Select(p => new { p.id, p.val })));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
333 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
334
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
335 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
336 public void Union41()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
337 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
338 ForEachProvider(db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
339 (from p in Parent select new { id = p.ParentID, val = true }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
340 (from ch in Child select new { id = ch.ParentID, val = false }))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
341 .Select(p => p),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
342 (from p in db.Parent select new { id = p.ParentID, val = true }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
343 (from ch in db.Child select new { id = ch.ParentID, val = false }))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
344 .Select(p => p)));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
345 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
346
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
347 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
348 public void Union42()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
349 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
350 ForEachProvider(db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
351 (from p in Parent select new { id = p. ParentID, val = true }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
352 (from ch in Child select new { id = ch.ParentID, val = false }))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
353 .Select(p => p.val),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
354 (from p in db.Parent select new { id = p. ParentID, val = true }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
355 (from ch in db.Child select new { id = ch.ParentID, val = false }))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
356 .Select(p => p.val)));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
357 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
358
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
359 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
360 public void Union421()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
361 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
362 ForEachProvider(db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
363 (from p in Parent select new { id = p. ParentID, val = true }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
364 (from p in Parent select new { id = p. ParentID, val = false }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
365 (from ch in Child select new { id = ch.ParentID, val = false })))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
366 .Select(p => p.val),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
367 (from p in db.Parent select new { id = p. ParentID, val = true }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
368 (from p in db.Parent select new { id = p. ParentID, val = false }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
369 (from ch in db.Child select new { id = ch.ParentID, val = false })))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
370 .Select(p => p.val)));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
371 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
372
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
373 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
374 public void Union5()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
375 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
376 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
377 new[] { ProviderName.Informix },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
378 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
379 (from p1 in Parent select p1).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
380 (from p2 in Parent select new Parent { ParentID = p2.ParentID }))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
381 .Select(p => new Parent { ParentID = p.ParentID, Value1 = p.Value1 }),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
382 (from p1 in db.Parent select p1).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
383 (from p2 in db.Parent select new Parent { ParentID = p2.ParentID }))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
384 .Select(p => new Parent { ParentID = p.ParentID, Value1 = p.Value1 })));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
385 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
386
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
387 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
388 public void Union51()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
389 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
390 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
391 new[] { ProviderName.Informix },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
392 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
393 (from p1 in Parent select p1).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
394 (from p2 in Parent select new Parent { ParentID = p2.ParentID })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
395 (from p1 in db.Parent select p1).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
396 (from p2 in db.Parent select new Parent { ParentID = p2.ParentID }))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
397 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
398
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
399 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
400 public void Union52()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
401 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
402 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
403 new[] { ProviderName.Access, ProviderName.Informix },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
404 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
405 (from p1 in Parent select new Parent { ParentID = p1.ParentID }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
406 (from p2 in Parent select p2)),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
407 (from p1 in db.Parent select new Parent { ParentID = p1.ParentID }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
408 (from p2 in db.Parent select p2))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
409 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
410
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
411 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
412 public void Union521()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
413 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
414 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
415 new[] { ProviderName.Access, ProviderName.Informix },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
416 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
417 (from p1 in Parent select new Parent { ParentID = p1.ParentID }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
418 (from p2 in Parent select p2))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
419 .Select(p => p.Value1),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
420 (from p1 in db.Parent select new Parent { ParentID = p1.ParentID }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
421 (from p2 in db.Parent select p2))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
422 .Select(p => p.Value1)));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
423 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
424
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
425 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
426 public void Union522()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
427 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
428 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
429 new[] { ProviderName.Access, ProviderName.Informix },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
430 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
431 (from p1 in Parent select new Parent { Value1 = p1.Value1 }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
432 (from p2 in Parent select p2)),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
433 (from p1 in db.Parent select new Parent { Value1 = p1.Value1 }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
434 (from p2 in db.Parent select p2))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
435 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
436
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
437 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
438 public void Union523()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
439 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
440 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
441 new[] { ProviderName.Access, ProviderName.Informix },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
442 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
443 (from p1 in Parent select new Parent { ParentID = p1.ParentID }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
444 (from p2 in Parent select p2)),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
445 (from p1 in db.Parent select new Parent { ParentID = p1.ParentID }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
446 (from p2 in db.Parent select p2))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
447 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
448
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
449 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
450 public void Union53()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
451 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
452 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
453 new[] { ProviderName.Access, ProviderName.Informix },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
454 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
455 (from p1 in Parent select new Parent { ParentID = p1.ParentID }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
456 (from p2 in Parent select new Parent { Value1 = p2.Value1 })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
457 (from p1 in db.Parent select new Parent { ParentID = p1.ParentID }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
458 (from p2 in db.Parent select new Parent { Value1 = p2.Value1 }))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
459 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
460
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
461 //[Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
462 public void Union54()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
463 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
464 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
465 //new[] { ProviderName.Access, ProviderName.Informix },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
466 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
467 (from p1 in Parent select new { ParentID = p1.ParentID, p = p1, ch = (Child)null }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
468 (from p2 in Parent select new { ParentID = p2.Value1 ?? 0, p = (Parent)null, ch = p2.Children.First() })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
469 (from p1 in db.Parent select new { ParentID = p1.ParentID, p = p1, ch = (Child)null }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
470 (from p2 in db.Parent select new { ParentID = p2.Value1 ?? 0, p = (Parent)null, ch = p2.Children.First() }))));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
471 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
472
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
473 //[Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
474 public void Union541()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
475 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
476 ForEachProvider(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
477 //new[] { ProviderName.Access, ProviderName.Informix },
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
478 db => AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
479 (from p1 in Parent select new { ParentID = p1.ParentID, p = p1, ch = (Child)null }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
480 (from p2 in Parent select new { ParentID = p2.Value1 ?? 0, p = (Parent)null, ch = p2.Children.First() }))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
481 .Select(p => new { p.ParentID, p.p, p.ch }),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
482 (from p1 in db.Parent select new { ParentID = p1.ParentID, p = p1, ch = (Child)null }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
483 (from p2 in db.Parent select new { ParentID = p2.Value1 ?? 0, p = (Parent)null, ch = p2.Children.First() }))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
484 .Select(p => new { p.ParentID, p.p, p.ch })));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
485 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
486
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
487 [TableName("Parent")]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
488 public abstract class AbstractParent
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
489 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
490 public abstract int ParentID { get; set; }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
491 public abstract int? Value1 { get; set; }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
492 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
493
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
494 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
495 public void UnionAbstract1([DataContexts] string context)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
496 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
497 using (var db = GetDataContext(context))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
498 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
499 var list = db.GetTable<AbstractParent>().Union(db.GetTable<AbstractParent>()).ToList();
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
500 Assert.AreEqual(Parent.Count(), list.Count);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
501 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
502 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
503
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
504 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
505 public void ObjectUnion1([DataContexts] string context)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
506 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
507 using (var db = GetDataContext(context))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
508 AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
509 (from p1 in Parent where p1.ParentID > 3 select p1).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
510 (from p2 in Parent where p2.ParentID <= 3 select p2)),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
511 (from p1 in db.Parent where p1.ParentID > 3 select p1).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
512 (from p2 in db.Parent where p2.ParentID <= 3 select p2)));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
513 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
514
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
515 //////[Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
516 public void ObjectUnion2([DataContexts] string context)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
517 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
518 using (var db = GetDataContext(context))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
519 AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
520 (from p1 in Parent where p1.ParentID > 3 select p1).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
521 (from p2 in Parent where p2.ParentID <= 3 select (Parent)null)),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
522 (from p1 in db.Parent where p1.ParentID > 3 select p1).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
523 (from p2 in db.Parent where p2.ParentID <= 3 select (Parent)null)));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
524 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
525
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
526 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
527 public void ObjectUnion3([DataContexts] string context)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
528 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
529 using (var db = GetDataContext(context))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
530 AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
531 (from p1 in Parent where p1.ParentID > 3 select new { p = p1 }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
532 (from p2 in Parent where p2.ParentID <= 3 select new { p = p2 })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
533 (from p1 in db.Parent where p1.ParentID > 3 select new { p = p1 }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
534 (from p2 in db.Parent where p2.ParentID <= 3 select new { p = p2 })));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
535 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
536
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
537 //////[Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
538 public void ObjectUnion4([DataContexts] string context)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
539 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
540 using (var db = GetDataContext(context))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
541 AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
542 (from p1 in Parent where p1.ParentID > 3 select new { p = new { p = p1, p1.ParentID } }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
543 (from p2 in Parent where p2.ParentID <= 3 select new { p = new { p = p2, p2.ParentID } })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
544 (from p1 in db.Parent where p1.ParentID > 3 select new { p = new { p = p1, p1.ParentID } }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
545 (from p2 in db.Parent where p2.ParentID <= 3 select new { p = new { p = p2, p2.ParentID } })));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
546 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
547
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
548 //////[Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
549 public void ObjectUnion5([DataContexts] string context)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
550 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
551 using (var db = GetDataContext(context))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
552 AreEqual(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
553 (from p1 in Parent where p1.ParentID > 3 select new { p = new { p = p1, ParentID = p1.ParentID + 1 } }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
554 (from p2 in Parent where p2.ParentID <= 3 select new { p = new { p = p2, ParentID = p2.ParentID + 1 } })),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
555 (from p1 in db.Parent where p1.ParentID > 3 select new { p = new { p = p1, ParentID = p1.ParentID + 1 } }).Union(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
556 (from p2 in db.Parent where p2.ParentID <= 3 select new { p = new { p = p2, ParentID = p2.ParentID + 1 } })));
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
557 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
558
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
559 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
560 public void ObjectUnion()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
561 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
562 using (var db = new NorthwindDB())
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
563 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
564 var q1 =
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
565 from p in db.Product
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
566 join c in db.Category on p.CategoryID equals c.CategoryID into g
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
567 from c in g.DefaultIfEmpty()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
568 select new
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
569 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
570 p,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
571 c.CategoryName,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
572 p.ProductName
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
573 };
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
574
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
575 var q2 =
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
576 from p in db.Product
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
577 join c in db.Category on p.CategoryID equals c.CategoryID into g
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
578 from c in g.DefaultIfEmpty()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
579 select new
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
580 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
581 p,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
582 c.CategoryName,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
583 p.ProductName
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
584 };
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
585
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
586 var q = q1.Union(q2).Take(5);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
587
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
588 foreach (var item in q)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
589 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
590 Console.WriteLine(item);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
591 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
592 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
593 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
594
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
595 public class TestEntity1 { public int Id; public string Field1; }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
596 public class TestEntity2 { public int Id; public string Field1; }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
597
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
598 [Test]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
599 public void Concat90()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
600 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
601 using(var context = new TestDbManager())
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
602 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
603 var join1 =
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
604 from t1 in context.GetTable<TestEntity1>()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
605 join t2 in context.GetTable<TestEntity2>()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
606 on t1.Id equals t2.Id
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
607 into tmp
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
608 from t2 in tmp.DefaultIfEmpty()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
609 select new { t1, t2 };
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
610
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
611 var join1Sql = join1.ToString();
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
612 Assert.IsNotNull(join1Sql);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
613
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
614 var join2 =
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
615 from t2 in context.GetTable<TestEntity2>()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
616 join t1 in context.GetTable<TestEntity1>()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
617 on t2.Id equals t1.Id
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
618 into tmp
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
619 from t1 in tmp.DefaultIfEmpty()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
620 where t1 == null
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
621 select new { t1, t2 };
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
622
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
623 var join2Sql = join2.ToString();
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
624 Assert.IsNotNull(join2Sql);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
625
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
626 var fullJoin = join1.Concat(join2);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
627
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
628 var fullJoinSql = fullJoin.ToString(); // BLToolkit.Data.Linq.LinqException : Types in Concat are constructed incompatibly.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
629 Assert.IsNotNull(fullJoinSql);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
630 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
631 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
632 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
633 }