You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varquery=fromg1incontext.Gears.Include(g =>g.Weapons)
join g2incontext.Gears
on g1.LeaderNickname equals g2.Nickname into groupingfromg2ingrouping.DefaultIfEmpty()selectg2??g1;varresult=query.ToList();
Generates following SQL
SELECT [t].[Nickname], [t].[SquadId], [t].[AssignedCityName], [t].[CityOrBirthName], [t].[Discriminator], [t].[FullName], [t].[HasSoulPatch], [t].[LeaderNickname], [t].[LeaderSquadId], [t].[Rank], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOrBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank], [w].[Id], [w].[AmmunitionType], [w].[IsAutomatic], [w].[Name], [w].[OwnerFullName], [w].[SynergyWithId]
FROM [Gears] AS [g0]
LEFT JOIN (
SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOrBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank]
FROM [Gears] AS [g]
WHERE [g].[Discriminator] IN (N'Gear', N'Officer')
) AS [t] ON [g0].[LeaderNickname] = [t].[Nickname]
LEFT JOIN [Weapons] AS [w] ON [g0].[FullName] = [w].[OwnerFullName]
WHERE [g0].[Discriminator] IN (N'Gear', N'Officer')
ORDER BY [g0].[Nickname], [g0].[SquadId], [w].[Id]
Left Join on Weapons could be restricted so that it only applies when g1 is selected in LINQ.
Currently it generate SQL as if it applies include on both though generate correct result (i.e. including on client only when particular gear is selected.
The text was updated successfully, but these errors were encountered:
Generates following SQL
Left Join on Weapons could be restricted so that it only applies when g1 is selected in LINQ.
Currently it generate SQL as if it applies include on both though generate correct result (i.e. including on client only when particular gear is selected.
The text was updated successfully, but these errors were encountered: