Skip to content

Commit 62fb0b4

Browse files
committed
Adding extra include tests and enabling some more that were switched off.
CR: Andrew
1 parent 13d659f commit 62fb0b4

File tree

7 files changed

+231
-25
lines changed

7 files changed

+231
-25
lines changed

EntityFramework.sln

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
Microsoft Visual Studio Solution File, Format Version 12.00
32
# Visual Studio 14
43
VisualStudioVersion = 14.0.25025.0

test/Microsoft.EntityFrameworkCore.FunctionalTests/ComplexNavigationsQueryTestBase.cs

Lines changed: 114 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,7 @@ public virtual void Multi_level_include_with_short_circuiting()
228228
}
229229
}
230230

231-
// issue #3186
232-
////[ConditionalFact]
231+
[ConditionalFact]
233232
public virtual void Join_navigation_key_access_optional()
234233
{
235234
List<Level1> levelOnes;
@@ -295,8 +294,7 @@ join l2 in levelTwos on l1.Id equals l2.OneToOne_Required_FK_Inverse?.Id
295294
}
296295
}
297296

298-
// issue #3186
299-
////[ConditionalFact]
297+
[ConditionalFact]
300298
public virtual void Navigation_key_access_optional_comparison()
301299
{
302300
List<Level2> levelTwos;
@@ -1860,13 +1858,124 @@ public virtual void Include_with_optional_navigation()
18601858
}
18611859
}
18621860

1861+
[ConditionalFact]
1862+
public virtual void Include_nested_with_optional_navigation()
1863+
{
1864+
List<Level1> expected;
1865+
using (var context = CreateContext())
1866+
{
1867+
expected = (from l1 in context.LevelOne
1868+
.Include(e => e.OneToOne_Optional_FK.OneToMany_Required)
1869+
.ThenInclude(e => e.OneToOne_Required_FK).ToList()
1870+
where l1.OneToOne_Optional_FK?.Name != "L2 09"
1871+
select l1).ToList();
1872+
}
1873+
1874+
ClearLog();
1875+
1876+
using (var context = CreateContext())
1877+
{
1878+
var query = from l1 in context.LevelOne
1879+
.Include(e => e.OneToOne_Optional_FK.OneToMany_Required)
1880+
.ThenInclude(e => e.OneToOne_Required_FK)
1881+
where l1.OneToOne_Optional_FK.Name != "L2 09"
1882+
select l1;
1883+
1884+
var result = query.ToList();
1885+
1886+
Assert.Equal(expected.Count, result.Count);
1887+
for (var i = 0; i < result.Count; i++)
1888+
{
1889+
var expectedElement = expected.Where(e => e.Id == result[i].Id).Single();
1890+
1891+
Assert.Equal(expectedElement.OneToOne_Optional_FK?.Id, result[i].OneToOne_Optional_FK?.Id);
1892+
Assert.Equal(expectedElement.OneToOne_Optional_FK?.Name, result[i].OneToOne_Optional_FK?.Name);
1893+
1894+
var resultCollection = result[i].OneToOne_Optional_FK?.OneToMany_Required;
1895+
Assert.Equal(expectedElement.OneToOne_Optional_FK?.OneToMany_Required?.Count, resultCollection?.Count);
1896+
1897+
if (resultCollection != null)
1898+
{
1899+
foreach (var inner in resultCollection)
1900+
{
1901+
Assert.True(expectedElement.OneToOne_Optional_FK.OneToMany_Required.Select(e => e.Id).Contains(inner.Id));
1902+
}
1903+
}
1904+
}
1905+
}
1906+
}
1907+
1908+
[ConditionalFact]
1909+
public virtual void Include_with_groupjoin_skip_and_take()
1910+
{
1911+
List<KeyValuePair<Level1, IEnumerable<Level2>>> expected;
1912+
using (var context = CreateContext())
1913+
{
1914+
expected = (from l1 in context.LevelOne
1915+
.Include(e => e.OneToMany_Optional)
1916+
.ThenInclude(e => e.OneToOne_Optional_FK)
1917+
.ToList()
1918+
join l2 in context.LevelTwo
1919+
.Include(e => e.OneToOne_Required_PK)
1920+
.ToList()
1921+
on (int?)l1.Id equals (l2 != null ? l2.Level1_Optional_Id : null) into grouping
1922+
where l1.Name != "L1 03" || l1.Name == null
1923+
select new KeyValuePair<Level1, IEnumerable<Level2>>(l1, grouping)).ToList();
1924+
}
1925+
1926+
ClearLog();
1927+
1928+
using (var context = CreateContext())
1929+
{
1930+
var query = (from l1 in context.LevelOne
1931+
.Include(e => e.OneToMany_Optional)
1932+
.ThenInclude(e => e.OneToOne_Optional_FK)
1933+
join l2 in context.LevelTwo.Include(e => e.OneToOne_Required_PK)
1934+
on (int?)l1.Id equals (l2 != null ? l2.Level1_Optional_Id : null) into grouping
1935+
where l1.Name != "L1 03"
1936+
select new { l1, grouping }).Skip(1).Take(5);
1937+
1938+
var result = query.ToList();
1939+
1940+
Assert.Equal(5, result.Count);
1941+
for (var i = 0; i < result.Count; i++)
1942+
{
1943+
var expectedElement = expected.Where(e => e.Key.Id == result[i].l1.Id).Single();
1944+
1945+
var expectedOneToManyOptional = expectedElement.Key.OneToMany_Optional?.ToList();
1946+
var actualOneToManyOptional = result[i].l1.OneToMany_Optional?.ToList();
1947+
1948+
Assert.Equal(expectedOneToManyOptional?.Count, actualOneToManyOptional?.Count);
1949+
if (expectedOneToManyOptional != null)
1950+
{
1951+
for (int j = 0; j < expectedOneToManyOptional.Count; j++)
1952+
{
1953+
Assert.Equal(expectedOneToManyOptional[j].OneToOne_Optional_FK.Id, actualOneToManyOptional[j].OneToOne_Optional_FK.Id);
1954+
}
1955+
}
1956+
1957+
var expectedGrouping = expectedElement.Value?.ToList();
1958+
var actualGrouping = result[i].grouping?.ToList();
1959+
Assert.Equal(expectedGrouping?.Count(), result[i].grouping?.Count());
1960+
if (expectedGrouping != null)
1961+
{
1962+
for (int j = 0; j < expectedGrouping.Count(); j++)
1963+
{
1964+
Assert.Equal(expectedGrouping[j].Id, actualGrouping[j].Id);
1965+
Assert.Equal(expectedGrouping[j].OneToOne_Required_PK.Id, actualGrouping[j].OneToOne_Required_PK.Id);
1966+
}
1967+
}
1968+
}
1969+
}
1970+
}
1971+
18631972
////[ConditionalFact]
18641973
public virtual void Join_flattening_bug_4539()
18651974
{
18661975
using (var context = CreateContext())
18671976
{
18681977
var query = from l1 in context.LevelOne
1869-
join l1_Optional in context.LevelTwo on (int?)l1.Id equals EF.Property<int?>(l1_Optional, "Level1_Optional_Id") into grouping
1978+
join l1_Optional in context.LevelTwo on (int?)l1.Id equals l1_Optional.Level1_Optional_Id into grouping
18701979
from l1_Optional in grouping.DefaultIfEmpty()
18711980
from l2 in context.LevelTwo
18721981
join l2_Required_Reverse in context.LevelOne on l2.Level1_Required_Id equals l2_Required_Reverse.Id

test/Microsoft.EntityFrameworkCore.FunctionalTests/GearsOfWarQueryTestBase.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,7 @@ public virtual void Include_navigation_on_derived_type()
248248
}
249249
}
250250

251-
// TODO: include doesn't work with optional navigations
252-
////[ConditionalFact]
251+
[ConditionalFact]
253252
public virtual void Select_Where_Navigation_Included()
254253
{
255254
using (var context = CreateContext())
@@ -400,8 +399,7 @@ public virtual void Include_with_join_and_inheritance3()
400399
}
401400
}
402401

403-
// TODO: include doesn't work with optional navigations
404-
////[ConditionalFact]
402+
[ConditionalFact]
405403
public virtual void Include_with_nested_navigation_in_order_by()
406404
{
407405
using (var context = CreateContext())

test/Microsoft.EntityFrameworkCore.FunctionalTests/QueryNavigationsTestBase.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ from o2 in context.Set<Order>()
177177
}
178178
}
179179

180-
// TODO: include doesn't work with optional navigations
181-
////[ConditionalFact]
180+
[ConditionalFact]
182181
public virtual void Select_Where_Navigation_Included()
183182
{
184183
using (var context = CreateContext())

test/Microsoft.EntityFrameworkCore.SqlServer.FunctionalTests/ComplexNavigationsQuerySqlServerTest.cs

Lines changed: 102 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,14 @@ public override void Join_navigation_key_access_optional()
136136
base.Join_navigation_key_access_optional();
137137

138138
Assert.Equal(
139-
@"", Sql);
139+
@"SELECT [e1].[Id], [e2].[Id]
140+
FROM [Level1] AS [e1]
141+
INNER JOIN [Level2] AS [e2] ON [e1].[Id] = (
142+
SELECT TOP(1) [subQuery0].[Id]
143+
FROM [Level1] AS [subQuery0]
144+
WHERE [subQuery0].[Id] = [e2].[Level1_Optional_Id]
145+
)",
146+
Sql);
140147
}
141148

142149
public override void Join_navigation_key_access_required()
@@ -146,15 +153,20 @@ public override void Join_navigation_key_access_required()
146153
Assert.Equal(
147154
@"SELECT [e1].[Id], [e2].[Id]
148155
FROM [Level1] AS [e1]
149-
INNER JOIN [Level2] AS [e2] ON [e1].[Id] = [e2].[Level1_Required_Id]", Sql);
156+
INNER JOIN [Level2] AS [e2] ON [e1].[Id] = [e2].[Level1_Required_Id]",
157+
Sql);
150158
}
151159

152160
public override void Navigation_key_access_optional_comparison()
153161
{
154162
base.Navigation_key_access_optional_comparison();
155163

156164
Assert.Equal(
157-
@"", Sql);
165+
@"SELECT [e2].[Id], [e2].[Level1_Optional_Id], [e2].[Level1_Required_Id], [e2].[Name], [e2].[OneToMany_Optional_InverseId], [e2].[OneToMany_Optional_Self_InverseId], [e2].[OneToMany_Required_InverseId], [e2].[OneToMany_Required_Self_InverseId], [e2].[OneToOne_Optional_PK_InverseId], [e2].[OneToOne_Optional_SelfId], [e2.OneToOne_Optional_PK_Inverse].[Id], [e2.OneToOne_Optional_PK_Inverse].[Name], [e2.OneToOne_Optional_PK_Inverse].[OneToMany_Optional_Self_InverseId], [e2.OneToOne_Optional_PK_Inverse].[OneToMany_Required_Self_InverseId], [e2.OneToOne_Optional_PK_Inverse].[OneToOne_Optional_SelfId]
166+
FROM [Level2] AS [e2]
167+
LEFT JOIN [Level1] AS [e2.OneToOne_Optional_PK_Inverse] ON [e2].[OneToOne_Optional_PK_InverseId] = [e2.OneToOne_Optional_PK_Inverse].[Id]
168+
ORDER BY [e2].[OneToOne_Optional_PK_InverseId]",
169+
Sql);
158170
}
159171

160172
public override void Navigation_key_access_required_comparison()
@@ -846,6 +858,93 @@ FROM [Level1] AS [e]
846858
Sql);
847859
}
848860

861+
public override void Include_nested_with_optional_navigation()
862+
{
863+
base.Include_nested_with_optional_navigation();
864+
865+
Assert.Equal(
866+
@"SELECT [e].[Id], [e].[Name], [e].[OneToMany_Optional_Self_InverseId], [e].[OneToMany_Required_Self_InverseId], [e].[OneToOne_Optional_SelfId], [e.OneToOne_Optional_FK].[Id], [e.OneToOne_Optional_FK].[Level1_Optional_Id], [e.OneToOne_Optional_FK].[Level1_Required_Id], [e.OneToOne_Optional_FK].[Name], [e.OneToOne_Optional_FK].[OneToMany_Optional_InverseId], [e.OneToOne_Optional_FK].[OneToMany_Optional_Self_InverseId], [e.OneToOne_Optional_FK].[OneToMany_Required_InverseId], [e.OneToOne_Optional_FK].[OneToMany_Required_Self_InverseId], [e.OneToOne_Optional_FK].[OneToOne_Optional_PK_InverseId], [e.OneToOne_Optional_FK].[OneToOne_Optional_SelfId], [l].[Id], [l].[Level1_Optional_Id], [l].[Level1_Required_Id], [l].[Name], [l].[OneToMany_Optional_InverseId], [l].[OneToMany_Optional_Self_InverseId], [l].[OneToMany_Required_InverseId], [l].[OneToMany_Required_Self_InverseId], [l].[OneToOne_Optional_PK_InverseId], [l].[OneToOne_Optional_SelfId]
867+
FROM [Level1] AS [e]
868+
LEFT JOIN [Level2] AS [e.OneToOne_Optional_FK] ON [e].[Id] = [e.OneToOne_Optional_FK].[Level1_Optional_Id]
869+
LEFT JOIN [Level2] AS [l] ON [l].[Level1_Optional_Id] = [e].[Id]
870+
ORDER BY [e].[Id], [l].[Id]
871+
872+
SELECT [l0].[Id], [l0].[Level2_Optional_Id], [l0].[Level2_Required_Id], [l0].[Name], [l0].[OneToMany_Optional_InverseId], [l0].[OneToMany_Optional_Self_InverseId], [l0].[OneToMany_Required_InverseId], [l0].[OneToMany_Required_Self_InverseId], [l0].[OneToOne_Optional_PK_InverseId], [l0].[OneToOne_Optional_SelfId], [l2].[Id], [l2].[Level3_Optional_Id], [l2].[Level3_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_InverseId], [l2].[OneToMany_Optional_Self_InverseId], [l2].[OneToMany_Required_InverseId], [l2].[OneToMany_Required_Self_InverseId], [l2].[OneToOne_Optional_PK_InverseId], [l2].[OneToOne_Optional_SelfId]
873+
FROM [Level3] AS [l0]
874+
INNER JOIN (
875+
SELECT DISTINCT [e].[Id], [l].[Id] AS [Id0]
876+
FROM [Level1] AS [e]
877+
LEFT JOIN [Level2] AS [e.OneToOne_Optional_FK] ON [e].[Id] = [e.OneToOne_Optional_FK].[Level1_Optional_Id]
878+
LEFT JOIN [Level2] AS [l] ON [l].[Level1_Optional_Id] = [e].[Id]
879+
) AS [l1] ON [l0].[OneToMany_Required_InverseId] = [l1].[Id0]
880+
LEFT JOIN [Level4] AS [l2] ON [l2].[Level3_Required_Id] = [l0].[Id]
881+
ORDER BY [l1].[Id], [l1].[Id0]",
882+
Sql);
883+
}
884+
885+
public override void Include_with_groupjoin_skip_and_take()
886+
{
887+
base.Include_with_groupjoin_skip_and_take();
888+
889+
Assert.Equal(
890+
@"@__p_0: ?
891+
@__p_1: ?
892+
893+
SELECT [e].[Id], [e].[Name], [e].[OneToMany_Optional_Self_InverseId], [e].[OneToMany_Required_Self_InverseId], [e].[OneToOne_Optional_SelfId], [t].[Id], [t].[Level1_Optional_Id], [t].[Level1_Required_Id], [t].[Name], [t].[OneToMany_Optional_InverseId], [t].[OneToMany_Optional_Self_InverseId], [t].[OneToMany_Required_InverseId], [t].[OneToMany_Required_Self_InverseId], [t].[OneToOne_Optional_PK_InverseId], [t].[OneToOne_Optional_SelfId], [l1].[Id], [l1].[Level2_Optional_Id], [l1].[Level2_Required_Id], [l1].[Name], [l1].[OneToMany_Optional_InverseId], [l1].[OneToMany_Optional_Self_InverseId], [l1].[OneToMany_Required_InverseId], [l1].[OneToMany_Required_Self_InverseId], [l1].[OneToOne_Optional_PK_InverseId], [l1].[OneToOne_Optional_SelfId]
894+
FROM [Level1] AS [e]
895+
LEFT JOIN (
896+
SELECT [e1].[Id], [e1].[Level1_Optional_Id], [e1].[Level1_Required_Id], [e1].[Name], [e1].[OneToMany_Optional_InverseId], [e1].[OneToMany_Optional_Self_InverseId], [e1].[OneToMany_Required_InverseId], [e1].[OneToMany_Required_Self_InverseId], [e1].[OneToOne_Optional_PK_InverseId], [e1].[OneToOne_Optional_SelfId]
897+
FROM [Level2] AS [e1]
898+
) AS [t] ON [e].[Id] = [t].[Level1_Optional_Id]
899+
LEFT JOIN [Level3] AS [l1] ON [l1].[Id] = [t].[Id]
900+
WHERE ([e].[Name] <> N'L1 03') OR [e].[Name] IS NULL
901+
ORDER BY [e].[Id]
902+
OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY
903+
904+
@__p_0: ?
905+
@__p_1: ?
906+
907+
SELECT [l].[Id], [l].[Level1_Optional_Id], [l].[Level1_Required_Id], [l].[Name], [l].[OneToMany_Optional_InverseId], [l].[OneToMany_Optional_Self_InverseId], [l].[OneToMany_Required_InverseId], [l].[OneToMany_Required_Self_InverseId], [l].[OneToOne_Optional_PK_InverseId], [l].[OneToOne_Optional_SelfId], [l0].[Id], [l0].[Level2_Optional_Id], [l0].[Level2_Required_Id], [l0].[Name], [l0].[OneToMany_Optional_InverseId], [l0].[OneToMany_Optional_Self_InverseId], [l0].[OneToMany_Required_InverseId], [l0].[OneToMany_Required_Self_InverseId], [l0].[OneToOne_Optional_PK_InverseId], [l0].[OneToOne_Optional_SelfId]
908+
FROM [Level2] AS [l]
909+
INNER JOIN (
910+
SELECT DISTINCT [t0].*
911+
FROM (
912+
SELECT [e].[Id]
913+
FROM [Level1] AS [e]
914+
LEFT JOIN (
915+
SELECT [e1].[Id], [e1].[Level1_Optional_Id], [e1].[Level1_Required_Id], [e1].[Name], [e1].[OneToMany_Optional_InverseId], [e1].[OneToMany_Optional_Self_InverseId], [e1].[OneToMany_Required_InverseId], [e1].[OneToMany_Required_Self_InverseId], [e1].[OneToOne_Optional_PK_InverseId], [e1].[OneToOne_Optional_SelfId]
916+
FROM [Level2] AS [e1]
917+
) AS [t] ON [e].[Id] = [t].[Level1_Optional_Id]
918+
WHERE ([e].[Name] <> N'L1 03') OR [e].[Name] IS NULL
919+
ORDER BY [e].[Id]
920+
OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY
921+
) AS [t0]
922+
) AS [e2] ON [l].[OneToMany_Optional_InverseId] = [e2].[Id]
923+
LEFT JOIN [Level3] AS [l0] ON [l0].[Level2_Optional_Id] = [l].[Id]
924+
ORDER BY [e2].[Id]",
925+
Sql);
926+
}
927+
928+
public override void Join_flattening_bug_4539()
929+
{
930+
base.Join_flattening_bug_4539();
931+
932+
Assert.Equal(
933+
@"",
934+
Sql);
935+
936+
}
937+
938+
public override void Query_source_materialization_bug_4547()
939+
{
940+
base.Query_source_materialization_bug_4547();
941+
942+
Assert.Equal(
943+
@"",
944+
Sql);
945+
}
946+
947+
849948
// issue #3491
850949
//[Fact]
851950
public virtual void Multiple_complex_includes_from_sql()

test/Microsoft.EntityFrameworkCore.SqlServer.FunctionalTests/GearsOfWarQuerySqlServerTest.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,15 @@ public override void Select_Where_Navigation_Included()
281281
base.Select_Where_Navigation_Included();
282282

283283
Assert.Equal(
284-
@"SELECT [o].[Id], [o].[GearNickName], [o].[GearSquadId], [o].[Note], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOrBirthName], [g].[Discriminator], [g].[FullName], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank]
284+
@"SELECT [o].[Id], [o].[GearNickName], [o].[GearSquadId], [o].[Note], [o.Gear].[Nickname], [o.Gear].[SquadId], [o.Gear].[AssignedCityName], [o.Gear].[CityOrBirthName], [o.Gear].[Discriminator], [o.Gear].[FullName], [o.Gear].[LeaderNickname], [o.Gear].[LeaderSquadId], [o.Gear].[Rank], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOrBirthName], [g].[Discriminator], [g].[FullName], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank]
285285
FROM [CogTag] AS [o]
286-
INNER JOIN [Gear] AS [o.Gear] ON ([o].[GearNickName] = [o.Gear].[Nickname]) AND ([o].[GearSquadId] = [o.Gear].[SquadId])
286+
LEFT JOIN [Gear] AS [o.Gear] ON ([o].[GearNickName] = [o.Gear].[Nickname]) AND ([o].[GearSquadId] = [o.Gear].[SquadId])
287287
LEFT JOIN (
288288
SELECT [g].*
289289
FROM [Gear] AS [g]
290290
WHERE [g].[Discriminator] IN (N'Officer', N'Gear')
291291
) AS [g] ON ([o].[GearNickName] = [g].[Nickname]) AND ([o].[GearSquadId] = [g].[SquadId])
292-
WHERE [o.Gear].[Nickname] = N'Marcus'",
292+
ORDER BY [o].[GearNickName], [o].[GearSquadId]",
293293
Sql);
294294
}
295295

@@ -468,16 +468,18 @@ public override void Include_with_nested_navigation_in_order_by()
468468
base.Include_with_nested_navigation_in_order_by();
469469

470470
Assert.Equal(
471-
@"SELECT [w].[Id], [w].[AmmunitionType], [w].[IsAutomatic], [w].[Name], [w].[OwnerFullName], [w].[SynergyWithId], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOrBirthName], [g].[Discriminator], [g].[FullName], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank]
471+
@"SELECT [w.Owner.CityOfBirth].[Name], [w.Owner.CityOfBirth].[Location]
472+
FROM [City] AS [w.Owner.CityOfBirth]
473+
474+
SELECT [w].[Id], [w].[AmmunitionType], [w].[IsAutomatic], [w].[Name], [w].[OwnerFullName], [w].[SynergyWithId], [w.Owner].[Nickname], [w.Owner].[SquadId], [w.Owner].[AssignedCityName], [w.Owner].[CityOrBirthName], [w.Owner].[Discriminator], [w.Owner].[FullName], [w.Owner].[LeaderNickname], [w.Owner].[LeaderSquadId], [w.Owner].[Rank], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOrBirthName], [g].[Discriminator], [g].[FullName], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank]
472475
FROM [Weapon] AS [w]
473-
INNER JOIN [Gear] AS [w.Owner] ON [w].[OwnerFullName] = [w.Owner].[FullName]
474-
INNER JOIN [City] AS [w.Owner.CityOfBirth] ON [w.Owner].[CityOrBirthName] = [w.Owner.CityOfBirth].[Name]
476+
LEFT JOIN [Gear] AS [w.Owner] ON [w].[OwnerFullName] = [w.Owner].[FullName]
475477
LEFT JOIN (
476478
SELECT [g].*
477479
FROM [Gear] AS [g]
478480
WHERE [g].[Discriminator] IN (N'Officer', N'Gear')
479481
) AS [g] ON [w].[OwnerFullName] = [g].[FullName]
480-
ORDER BY [w.Owner.CityOfBirth].[Name]",
482+
ORDER BY [w].[OwnerFullName]",
481483
Sql);
482484
}
483485

0 commit comments

Comments
 (0)