[Fact] // Codeplex #655 public static void LeftOuterJoin_duplicates_are_eliminated() { const string expectedSql = @"SELECT [Extent1].[DocumentDetailId] AS [DocumentDetailId], [Extent1].[DocumentId] AS [DocumentId] FROM [dbo].[DocumentDetails] AS [Extent1] LEFT OUTER JOIN [dbo].[Documents] AS [Extent2] ON [Extent1].[DocumentId] = [Extent2].[DocumentId] LEFT OUTER JOIN [dbo].[Customers] AS [Extent3] ON [Extent2].[CustomerId] = [Extent3].[CustomerId] WHERE [Extent3].[PersonId] IN (1,2)"; Database.SetInitializer<Codeplex655Context>(null); using (var context = new Codeplex655Context()) { context.Configuration.UseDatabaseNullSemantics = true; var query = context.DocumentDetails.Where(x => x.Document.Customer.PersonId == 1 || x.Document.Customer.PersonId == 2); QueryTestHelpers.VerifyQuery(query, expectedSql); } }
[Fact] // Codeplex #655 public static void LeftOuterJoin_duplicates_are_eliminated() { const string expectedSql = @"SELECT [Extent1].[DocumentDetailId] AS [DocumentDetailId], [Extent1].[DocumentId] AS [DocumentId] FROM [dbo].[DocumentDetails] AS [Extent1] LEFT OUTER JOIN [dbo].[Documents] AS [Extent2] ON [Extent1].[DocumentId] = [Extent2].[DocumentId] LEFT OUTER JOIN [dbo].[Customers] AS [Extent3] ON [Extent2].[CustomerId] = [Extent3].[CustomerId] WHERE [Extent3].[PersonId] IN (1,2)"; Database.SetInitializer <Codeplex655Context>(null); using (var context = new Codeplex655Context()) { context.Configuration.UseDatabaseNullSemantics = true; var query = context.DocumentDetails.Where(x => x.Document.Customer.PersonId == 1 || x.Document.Customer.PersonId == 2); QueryTestHelpers.VerifyQuery(query, expectedSql); } }