diff --git a/test/EFCore.Relational.Specification.Tests/Query/InheritanceRelationshipsQueryRelationalTestBase.cs b/test/EFCore.Relational.Specification.Tests/Query/InheritanceRelationshipsQueryRelationalTestBase.cs index 166379c9b9e..87a44a9e4c3 100644 --- a/test/EFCore.Relational.Specification.Tests/Query/InheritanceRelationshipsQueryRelationalTestBase.cs +++ b/test/EFCore.Relational.Specification.Tests/Query/InheritanceRelationshipsQueryRelationalTestBase.cs @@ -2,7 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; -using Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel; +using Microsoft.EntityFrameworkCore.TestUtilities; using Xunit; namespace Microsoft.EntityFrameworkCore.Query @@ -15,214 +17,232 @@ public InheritanceRelationshipsQueryRelationalTestBase(TFixture fixture) { } - [ConditionalFact] - public virtual void Include_collection_with_inheritance_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance_split(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.BaseCollectionOnBase); - var result = query.ToList(); - - Assert.Equal(6, result.Count); - Assert.Equal( - 3, result.SelectMany(e => e.BaseCollectionOnBase.OfType()).Count(e => e.DerivedProperty != 0)); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseCollectionOnBase), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseCollectionOnBase))); } - [ConditionalFact] - public virtual void Include_collection_with_inheritance_reverse_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance_reverse_split(bool async) { - using var context = CreateContext(); - var query = context.BaseCollectionsOnBase.Include(e => e.BaseParent); - var result = query.ToList(); - - Assert.Equal(13, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseParent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseParent))); } - [ConditionalFact] - public virtual void Include_collection_with_inheritance_with_filter_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance_with_filter_split(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.BaseCollectionOnBase).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(6, result.Count); - Assert.Equal( - 3, result.SelectMany(e => e.BaseCollectionOnBase.OfType()).Count(e => e.DerivedProperty != 0)); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseCollectionOnBase).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseCollectionOnBase))); } - [ConditionalFact] - public virtual void Include_collection_with_inheritance_with_filter_reverse_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance_with_filter_reverse_split(bool async) { - using var context = CreateContext(); - var query = context.BaseCollectionsOnBase.Include(e => e.BaseParent).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(13, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseParent).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseParent))); } - [ConditionalFact] - public virtual void Include_collection_without_inheritance_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_without_inheritance_split(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.CollectionOnBase); - var result = query.ToList(); - - Assert.Equal(6, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.CollectionOnBase), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.CollectionOnBase))); } - [ConditionalFact] - public virtual void Include_collection_without_inheritance_reverse_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_without_inheritance_reverse_split(bool async) { - using var context = CreateContext(); - var query = context.CollectionsOnBase.Include(e => e.Parent); - var result = query.ToList(); - - Assert.Equal(9, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.Parent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.Parent))); } - [ConditionalFact] - public virtual void Include_collection_without_inheritance_with_filter_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_without_inheritance_with_filter_split(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.CollectionOnBase).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(6, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.CollectionOnBase).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.CollectionOnBase))); } - [ConditionalFact] - public virtual void Include_collection_without_inheritance_with_filter_reverse_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_without_inheritance_with_filter_reverse_split(bool async) { - using var context = CreateContext(); - var query = context.CollectionsOnBase.Include(e => e.Parent).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(9, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.Parent).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.Parent))); } - [ConditionalFact] - public virtual void Include_collection_with_inheritance_on_derived1_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance_on_derived1_split(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.BaseCollectionOnBase); - var result = query.ToList(); - - Assert.Equal(3, result.Count); - Assert.Equal( - 2, result.SelectMany(e => e.BaseCollectionOnBase.OfType()).Count(e => e.DerivedProperty != 0)); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseCollectionOnBase), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseCollectionOnBase))); } - [ConditionalFact] - public virtual void Include_collection_with_inheritance_on_derived2_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance_on_derived2_split(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.BaseCollectionOnDerived); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseCollectionOnDerived), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseCollectionOnDerived))); } - [ConditionalFact] - public virtual void Include_collection_with_inheritance_on_derived3_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance_on_derived3_split(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.DerivedCollectionOnDerived); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.DerivedCollectionOnDerived), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.DerivedCollectionOnDerived))); } - [ConditionalFact] - public virtual void Include_collection_with_inheritance_on_derived_reverse_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance_on_derived_reverse_split(bool async) { - using var context = CreateContext(); - var query = context.BaseCollectionsOnDerived.Include(e => e.BaseParent); - var result = query.ToList(); - - Assert.Equal(7, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseParent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseParent))); } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_reference_collection_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_reference_collection_split(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.BaseReferenceOnBase.NestedCollection); - var result = query.ToList(); - - Assert.Equal(6, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseReferenceOnBase.NestedCollection), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseReferenceOnBase), + new ExpectedInclude(x => x.NestedCollection))); } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_reference_collection_on_base_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_reference_collection_on_base_split(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.BaseReferenceOnBase.NestedCollection); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseReferenceOnBase.NestedCollection), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseReferenceOnBase), + new ExpectedInclude(x => x.NestedCollection))); } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_reference_collection_reverse_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_reference_collection_reverse_split(bool async) { - using var context = CreateContext(); - var query = context.NestedCollections.Include(e => e.ParentReference.BaseParent); - var result = query.ToList(); - - Assert.Equal(13, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.ParentReference.BaseParent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.ParentReference), + new ExpectedInclude(x => x.BaseParent))); } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_collection_reference_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_collection_reference_split(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.BaseCollectionOnBase).ThenInclude(e => e.NestedReference); - var result = query.ToList(); - - Assert.Equal(6, result.Count); - Assert.Equal( - 3, result.SelectMany(e => e.BaseCollectionOnBase.OfType()).Count(e => e.DerivedProperty != 0)); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseCollectionOnBase).ThenInclude(e => e.NestedReference), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseCollectionOnBase), + new ExpectedInclude(x => x.NestedReference))); } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_collection_reference_reverse_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_collection_reference_reverse_split(bool async) { - using var context = CreateContext(); - var query = context.NestedReferences.Include(e => e.ParentCollection.BaseParent); - var result = query.ToList(); - - Assert.Equal(9, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.ParentCollection.BaseParent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.ParentCollection), + new ExpectedInclude(x => x.BaseParent))); } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_collection_collection_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_collection_collection_split(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.BaseCollectionOnBase).ThenInclude(e => e.NestedCollection); - var result = query.ToList(); - - Assert.Equal(6, result.Count); - Assert.Equal( - 3, result.SelectMany(e => e.BaseCollectionOnBase.OfType()).Count(e => e.DerivedProperty != 0)); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseCollectionOnBase).ThenInclude(e => e.NestedCollection), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseCollectionOnBase), + new ExpectedInclude(x => x.NestedCollection))); } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_collection_collection_reverse_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_collection_collection_reverse_split(bool async) { - using var context = CreateContext(); - var query = context.NestedCollections.Include(e => e.ParentCollection.BaseParent); - var result = query.ToList(); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.ParentCollection.BaseParent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.ParentCollection), + new ExpectedInclude(x => x.BaseParent))); + } - Assert.Equal(13, result.Count); - } - - [ConditionalFact] - public virtual void Nested_include_collection_reference_on_non_entity_base_split() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_collection_reference_on_non_entity_base_split(bool async) { - using var context = CreateContext(); - var query = context.ReferencedEntities.Include(e => e.Principals).ThenInclude(e => e.Reference); - var result = query.ToList(); - - Assert.Equal(2, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.Principals).ThenInclude(e => e.Reference), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.Principals), + new ExpectedInclude(x => x.Reference))); } } } diff --git a/test/EFCore.Relational.Specification.Tests/Query/TPTRelationshipsQueryRelationalFixture.cs b/test/EFCore.Relational.Specification.Tests/Query/TPTRelationshipsQueryRelationalFixture.cs index d736ab9d08c..55eca5f8c95 100644 --- a/test/EFCore.Relational.Specification.Tests/Query/TPTRelationshipsQueryRelationalFixture.cs +++ b/test/EFCore.Relational.Specification.Tests/Query/TPTRelationshipsQueryRelationalFixture.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships; +using Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel; namespace Microsoft.EntityFrameworkCore.Query { diff --git a/test/EFCore.Specification.Tests/Query/InheritanceRelationshipsQueryFixtureBase.cs b/test/EFCore.Specification.Tests/Query/InheritanceRelationshipsQueryFixtureBase.cs index 28bc0843fe2..5b708577d6b 100644 --- a/test/EFCore.Specification.Tests/Query/InheritanceRelationshipsQueryFixtureBase.cs +++ b/test/EFCore.Specification.Tests/Query/InheritanceRelationshipsQueryFixtureBase.cs @@ -1,14 +1,564 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships; +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel; +using Microsoft.EntityFrameworkCore.TestUtilities; +using Xunit; namespace Microsoft.EntityFrameworkCore.Query { - public abstract class InheritanceRelationshipsQueryFixtureBase : SharedStoreFixtureBase + public abstract class InheritanceRelationshipsQueryFixtureBase : SharedStoreFixtureBase, IQueryFixtureBase { protected override string StoreName { get; } = "InheritanceRelationships"; + public Func GetContextCreator() => () => CreateContext(); + + public ISetSource GetExpectedData() => new InheritanceRelationshipsData(); + + public IReadOnlyDictionary GetEntitySorters() + => new Dictionary> + { + { typeof(BaseCollectionOnBase), e => ((BaseCollectionOnBase)e)?.Id }, + { typeof(DerivedCollectionOnBase), e => ((DerivedCollectionOnBase)e)?.Id }, + + { typeof(BaseCollectionOnDerived), e => ((BaseCollectionOnDerived)e)?.Id }, + { typeof(DerivedCollectionOnDerived), e => ((DerivedCollectionOnDerived)e)?.Id }, + + { typeof(BaseInheritanceRelationshipEntity), e => ((BaseInheritanceRelationshipEntity)e)?.Id }, + { typeof(DerivedInheritanceRelationshipEntity), e => ((DerivedInheritanceRelationshipEntity)e)?.Id }, + + { typeof(BaseReferenceOnBase), e => ((BaseReferenceOnBase)e)?.Id }, + { typeof(DerivedReferenceOnBase), e => ((DerivedReferenceOnBase)e)?.Id }, + + { typeof(BaseReferenceOnDerived), e => ((BaseReferenceOnDerived)e)?.Id }, + { typeof(DerivedReferenceOnDerived), e => ((DerivedReferenceOnDerived)e)?.Id }, + + { typeof(CollectionOnBase), e => ((CollectionOnBase)e)?.Id }, + { typeof(CollectionOnDerived), e => ((CollectionOnDerived)e)?.Id }, + + { typeof(NestedCollectionBase), e => ((NestedCollectionBase)e)?.Id }, + { typeof(NestedCollectionDerived), e => ((NestedCollectionDerived)e)?.Id }, + + { typeof(NestedReferenceBase), e => ((NestedReferenceBase)e)?.Id }, + + { typeof(NonEntityBase), e => ((NonEntityBase)e)?.Id }, + { typeof(PrincipalEntity), e => ((PrincipalEntity)e)?.Id }, + + { typeof(OwnedEntity), e => ((OwnedEntity)e)?.Id }, + { typeof(ReferencedEntity), e => ((ReferencedEntity)e)?.Id }, + + { typeof(ReferenceOnBase), e => ((ReferenceOnBase)e)?.Id }, + { typeof(ReferenceOnDerived), e => ((ReferenceOnDerived)e)?.Id }, + }.ToDictionary(e => e.Key, e => (object)e.Value); + + + public IReadOnlyDictionary GetEntityAsserters() + => new Dictionary> + { + { + typeof(BaseCollectionOnBase), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (BaseCollectionOnBase)e; + var aa = (BaseCollectionOnBase)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.BaseParentId, aa.BaseParentId); + } + } + }, + { + typeof(DerivedCollectionOnBase), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (DerivedCollectionOnBase)e; + var aa = (DerivedCollectionOnBase)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.BaseParentId, aa.BaseParentId); + Assert.Equal(ee.DerivedProperty, aa.DerivedProperty); + + } + } + }, + { + typeof(BaseCollectionOnDerived), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (BaseCollectionOnDerived)e; + var aa = (BaseCollectionOnDerived)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.ParentId, aa.ParentId); + + } + } + }, + { + typeof(DerivedCollectionOnDerived), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (DerivedCollectionOnDerived)e; + var aa = (DerivedCollectionOnDerived)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.ParentId, aa.ParentId); + + } + } + }, + { + typeof(BaseInheritanceRelationshipEntity), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (BaseInheritanceRelationshipEntity)e; + var aa = (BaseInheritanceRelationshipEntity)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + + Assert.Equal(ee.OwnedReferenceOnBase?.Id, aa.OwnedReferenceOnBase?.Id); + Assert.Equal(ee.OwnedReferenceOnBase?.Name, aa.OwnedReferenceOnBase?.Name); + + Assert.Equal(ee.OwnedCollectionOnBase?.Count, aa.OwnedCollectionOnBase?.Count); + if (ee.OwnedCollectionOnBase?.Count > 0) + { + for (var i = 0; i < ee.OwnedCollectionOnBase.Count; i++) + { + Assert.Equal(ee.OwnedCollectionOnBase[i].Id, aa.OwnedCollectionOnBase[i].Id); + Assert.Equal(ee.OwnedCollectionOnBase[i].Name, aa.OwnedCollectionOnBase[i].Name); + } + } + } + } + }, + { + typeof(DerivedInheritanceRelationshipEntity), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (DerivedInheritanceRelationshipEntity)e; + var aa = (DerivedInheritanceRelationshipEntity)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.BaseId, aa.BaseId); + + Assert.Equal(ee.OwnedReferenceOnBase?.Id, aa.OwnedReferenceOnBase?.Id); + Assert.Equal(ee.OwnedReferenceOnBase?.Name, aa.OwnedReferenceOnBase?.Name); + + Assert.Equal(ee.OwnedReferenceOnDerived?.Id, aa.OwnedReferenceOnDerived?.Id); + Assert.Equal(ee.OwnedReferenceOnDerived?.Name, aa.OwnedReferenceOnDerived?.Name); + + Assert.Equal(ee.OwnedCollectionOnBase?.Count, aa.OwnedCollectionOnBase?.Count); + if (ee.OwnedCollectionOnBase?.Count > 0) + { + for (var i = 0; i < ee.OwnedCollectionOnBase.Count; i++) + { + Assert.Equal(ee.OwnedCollectionOnBase[i].Id, aa.OwnedCollectionOnBase[i].Id); + Assert.Equal(ee.OwnedCollectionOnBase[i].Name, aa.OwnedCollectionOnBase[i].Name); + } + } + + Assert.Equal(ee.OwnedCollectionOnDerived?.Count, aa.OwnedCollectionOnDerived?.Count); + if (ee.OwnedCollectionOnDerived?.Count > 0) + { + for (var i = 0; i < ee.OwnedCollectionOnDerived.Count; i++) + { + Assert.Equal(ee.OwnedCollectionOnDerived[i].Id, aa.OwnedCollectionOnDerived[i].Id); + Assert.Equal(ee.OwnedCollectionOnDerived[i].Name, aa.OwnedCollectionOnDerived[i].Name); + } + } + } + } + }, + { + typeof(BaseReferenceOnBase), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (BaseReferenceOnBase)e; + var aa = (BaseReferenceOnBase)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.BaseParentId, aa.BaseParentId); + } + } + }, + { + typeof(DerivedReferenceOnBase), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (DerivedReferenceOnBase)e; + var aa = (DerivedReferenceOnBase)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.BaseParentId, aa.BaseParentId); + } + } + }, + { + typeof(BaseReferenceOnDerived), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (BaseReferenceOnDerived)e; + var aa = (BaseReferenceOnDerived)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.BaseParentId, aa.BaseParentId); + } + } + }, + { + typeof(DerivedReferenceOnDerived), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (DerivedReferenceOnDerived)e; + var aa = (DerivedReferenceOnDerived)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.BaseParentId, aa.BaseParentId); + } + } + }, + { + typeof(CollectionOnBase), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (CollectionOnBase)e; + var aa = (CollectionOnBase)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.ParentId, aa.ParentId); + } + } + }, + { + typeof(CollectionOnDerived), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (CollectionOnDerived)e; + var aa = (CollectionOnDerived)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.ParentId, aa.ParentId); + } + } + }, + { + typeof(NestedCollectionBase), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (NestedCollectionBase)e; + var aa = (NestedCollectionBase)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.ParentReferenceId, aa.ParentReferenceId); + Assert.Equal(ee.ParentCollectionId, aa.ParentCollectionId); + } + } + }, + { + typeof(NestedCollectionDerived), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (NestedCollectionDerived)e; + var aa = (NestedCollectionDerived)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.ParentReferenceId, aa.ParentReferenceId); + Assert.Equal(ee.ParentCollectionId, aa.ParentCollectionId); + } + } + }, + { + typeof(NestedReferenceBase), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (NestedReferenceBase)e; + var aa = (NestedReferenceBase)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.ParentReferenceId, aa.ParentReferenceId); + Assert.Equal(ee.ParentCollectionId, aa.ParentCollectionId); + } + } + }, + { + typeof(NonEntityBase), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (NonEntityBase)e; + var aa = (NonEntityBase)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + } + } + }, + { + typeof(PrincipalEntity), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (PrincipalEntity)e; + var aa = (PrincipalEntity)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + } + } + }, + { + typeof(ReferencedEntity), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (ReferencedEntity)e; + var aa = (ReferencedEntity)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + } + } + }, + { + typeof(ReferenceOnBase), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (ReferenceOnBase)e; + var aa = (ReferenceOnBase)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.ParentId, aa.ParentId); + } + } + }, + { + typeof(ReferenceOnDerived), (e, a) => + { + Assert.Equal(e == null, a == null); + + if (a != null) + { + var ee = (ReferenceOnDerived)e; + var aa = (ReferenceOnDerived)a; + + Assert.Equal(ee.Id, aa.Id); + Assert.Equal(ee.Name, aa.Name); + Assert.Equal(ee.ParentId, aa.ParentId); + } + } + }, + + //{ typeof(OwnedEntity), e => ((OwnedEntity)e)?.Id }, + }.ToDictionary(e => e.Key, e => (object)e.Value); + + + protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context) + { + modelBuilder.Owned(); + modelBuilder.Entity(); + modelBuilder.Entity(); + modelBuilder.Entity(); + modelBuilder.Entity(); + modelBuilder.Entity(); + modelBuilder.Entity(); + + + modelBuilder.Entity().Property(e => e.Id).ValueGeneratedNever(); + modelBuilder.Entity().Property(e => e.Id).ValueGeneratedNever(); + modelBuilder.Entity().Property(e => e.Id).ValueGeneratedNever(); + modelBuilder.Entity().Property(e => e.Id).ValueGeneratedNever(); + modelBuilder.Entity().Property(e => e.Id).ValueGeneratedNever(); + modelBuilder.Entity().Property(e => e.Id).ValueGeneratedNever(); + modelBuilder.Entity().Property(e => e.Id).ValueGeneratedNever(); + modelBuilder.Entity().Property(e => e.Id).ValueGeneratedNever(); + modelBuilder.Entity().Property(e => e.Id).ValueGeneratedNever(); + modelBuilder.Entity().Property(e => e.Id).ValueGeneratedNever(); + modelBuilder.Entity().Property(e => e.Id).ValueGeneratedNever(); + modelBuilder.Entity().Property(e => e.Id).ValueGeneratedNever(); + modelBuilder.Entity().Property(e => e.Id).ValueGeneratedNever(); + + modelBuilder.Entity() + .HasOne(e => e.DerivedSefReferenceOnBase) + .WithOne(e => e.BaseSelfReferenceOnDerived) + .HasForeignKey(e => e.BaseId) + .IsRequired(false); + + modelBuilder.Entity() + .HasOne(e => e.BaseReferenceOnBase) + .WithOne(e => e.BaseParent) + .HasForeignKey(e => e.BaseParentId) + .IsRequired(false); + + modelBuilder.Entity() + .HasOne(e => e.ReferenceOnBase) + .WithOne(e => e.Parent) + .HasForeignKey(e => e.ParentId) + .IsRequired(false); + + modelBuilder.Entity() + .HasMany(e => e.BaseCollectionOnBase) + .WithOne(e => e.BaseParent) + .HasForeignKey(e => e.BaseParentId) + .IsRequired(false); + + modelBuilder.Entity() + .HasMany(e => e.CollectionOnBase) + .WithOne(e => e.Parent) + .HasForeignKey(e => e.ParentId) + .IsRequired(false); + + modelBuilder.Entity() + .OwnsMany(e => e.OwnedCollectionOnBase) + .Property(e => e.Id).ValueGeneratedNever(); + + modelBuilder.Entity() + .HasOne(e => e.DerivedReferenceOnDerived) + .WithOne() + .HasForeignKey("DerivedInheritanceRelationshipEntityId") + .IsRequired(false); + + modelBuilder.Entity() + .HasOne(e => e.ReferenceOnDerived) + .WithOne(e => e.Parent) + .HasForeignKey(e => e.ParentId) + .IsRequired(false); + + modelBuilder.Entity() + .HasMany(e => e.BaseCollectionOnDerived) + .WithOne(e => e.BaseParent) + .HasForeignKey(e => e.ParentId) + .IsRequired(false); + + modelBuilder.Entity() + .HasMany(e => e.CollectionOnDerived) + .WithOne(e => e.Parent) + .HasForeignKey(e => e.ParentId) + .IsRequired(false); + + modelBuilder.Entity() + .HasMany(e => e.DerivedCollectionOnDerived) + .WithOne() + .HasForeignKey("DerivedInheritanceRelationshipEntityId") + .IsRequired(false); + + modelBuilder.Entity() + .HasOne(e => e.BaseReferenceOnDerived) + .WithOne(e => e.BaseParent) + .HasForeignKey(e => e.BaseParentId) + .IsRequired(false); + + modelBuilder.Entity() + .OwnsMany(e => e.OwnedCollectionOnDerived) + .Property(e => e.Id).ValueGeneratedNever(); + + modelBuilder.Entity() + .HasOne(e => e.NestedReference) + .WithOne(e => e.ParentReference) + .HasForeignKey(e => e.ParentReferenceId) + .IsRequired(false); + + modelBuilder.Entity() + .HasMany(e => e.NestedCollection) + .WithOne(e => e.ParentReference) + .HasForeignKey(e => e.ParentReferenceId) + .IsRequired(false); + + modelBuilder.Entity() + .HasOne(e => e.NestedReference) + .WithOne(e => e.ParentCollection) + .HasForeignKey(e => e.ParentCollectionId) + .IsRequired(false); + + modelBuilder.Entity() + .HasMany(e => e.NestedCollection) + .WithOne(e => e.ParentCollection) + .HasForeignKey(e => e.ParentCollectionId) + .IsRequired(false); + + modelBuilder.Entity() + .HasOne(e => e.Reference) + .WithMany() + .IsRequired(false); + + modelBuilder.Entity() + .HasMany(e => e.Principals) + .WithOne() + .IsRequired(false); + } + protected override void Seed(InheritanceRelationshipsContext context) => InheritanceRelationshipsContext.Seed(context); diff --git a/test/EFCore.Specification.Tests/Query/InheritanceRelationshipsQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/InheritanceRelationshipsQueryTestBase.cs index df8a478e62d..de44eba6e89 100644 --- a/test/EFCore.Specification.Tests/Query/InheritanceRelationshipsQueryTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/InheritanceRelationshipsQueryTestBase.cs @@ -2,18 +2,21 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; -using Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel; +using Microsoft.EntityFrameworkCore.TestUtilities; using Xunit; // ReSharper disable InconsistentNaming namespace Microsoft.EntityFrameworkCore.Query { - public abstract class InheritanceRelationshipsQueryTestBase : IClassFixture + public abstract class InheritanceRelationshipsQueryTestBase : QueryTestBase where TFixture : InheritanceRelationshipsQueryFixtureBase, new() { - protected InheritanceRelationshipsQueryTestBase(TFixture fixture) => Fixture = fixture; - - protected TFixture Fixture { get; } + protected InheritanceRelationshipsQueryTestBase(TFixture fixture) + : base(fixture) + { + } [ConditionalFact] public virtual void Changes_in_derived_related_entities_are_detected() @@ -37,7 +40,7 @@ public virtual void Changes_in_derived_related_entities_are_detected() Assert.IsType(entry.Entity); Assert.Equal( - "Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships.DerivedCollectionOnBase", + "Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel.DerivedCollectionOnBase", entry.Metadata.Name); firstRelatedEntity.DerivedProperty = originalValue + 1; @@ -73,454 +76,501 @@ public virtual void Entity_can_make_separate_relationships_with_base_type_and_de Assert.Equal(nameof(DerivedInheritanceRelationshipEntity.DerivedReferenceOnDerived), fkOnDerived.PrincipalToDependent.Name); } - [ConditionalFact] - public virtual void Include_reference_with_inheritance() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_with_inheritance(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.BaseReferenceOnBase); - var result = query.ToList(); - - Assert.Equal(6, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseReferenceOnBase), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseReferenceOnBase))); } - [ConditionalFact] - public virtual void Include_reference_with_inheritance_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_with_inheritance_reverse(bool async) { - using var context = CreateContext(); - var query = context.BaseReferencesOnBase.Include(e => e.BaseParent); - var result = query.ToList(); - - Assert.Equal(8, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseParent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseParent))); } - [ConditionalFact] - public virtual void Include_self_reference_with_inheritance() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_self_reference_with_inheritance(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.DerivedSefReferenceOnBase); - var result = query.ToList(); - - Assert.Equal(6, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.DerivedSefReferenceOnBase), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.DerivedSefReferenceOnBase))); } - [ConditionalFact] - public virtual void Include_self_reference_with_inheritance_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_self_reference_with_inheritance_reverse(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.BaseSelfReferenceOnDerived); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseSelfReferenceOnDerived), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseSelfReferenceOnDerived))); } - [ConditionalFact] - public virtual void Include_reference_with_inheritance_with_filter() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_with_inheritance_with_filter(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.BaseReferenceOnBase).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(6, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseReferenceOnBase).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseReferenceOnBase))); } - [ConditionalFact] - public virtual void Include_reference_with_inheritance_with_filter_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_with_inheritance_with_filter_reverse(bool async) { - using var context = CreateContext(); - var query = context.BaseReferencesOnBase.Include(e => e.BaseParent).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(8, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseParent).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseParent))); } - [ConditionalFact] - public virtual void Include_reference_without_inheritance() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_without_inheritance(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.ReferenceOnBase); - var result = query.ToList(); - - Assert.Equal(6, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.ReferenceOnBase), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.ReferenceOnBase))); } - [ConditionalFact] - public virtual void Include_reference_without_inheritance_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_without_inheritance_reverse(bool async) { - using var context = CreateContext(); - var query = context.ReferencesOnBase.Include(e => e.Parent); - var result = query.ToList(); - - Assert.Equal(4, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.Parent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.Parent))); } - [ConditionalFact] - public virtual void Include_reference_without_inheritance_with_filter() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_without_inheritance_with_filter(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.ReferenceOnBase).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(6, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.ReferenceOnBase).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.ReferenceOnBase))); } - [ConditionalFact] - public virtual void Include_reference_without_inheritance_with_filter_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_without_inheritance_with_filter_reverse(bool async) { - using var context = CreateContext(); - var query = context.ReferencesOnBase.Include(e => e.Parent).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(4, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.Parent).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.Parent))); } - [ConditionalFact] - public virtual void Include_collection_with_inheritance() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.BaseCollectionOnBase); - var result = query.ToList(); - - Assert.Equal(6, result.Count); - Assert.Equal( - 3, result.SelectMany(e => e.BaseCollectionOnBase.OfType()).Count(e => e.DerivedProperty != 0)); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseCollectionOnBase), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseCollectionOnBase))); } - [ConditionalFact] - public virtual void Include_collection_with_inheritance_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance_reverse(bool async) { - using var context = CreateContext(); - var query = context.BaseCollectionsOnBase.Include(e => e.BaseParent); - var result = query.ToList(); - - Assert.Equal(13, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseParent), + elementAsserter: (e, a) => AssertInclude( + e, + a, + new ExpectedInclude(x => x.BaseParent))); } - [ConditionalFact] - public virtual void Include_collection_with_inheritance_with_filter() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance_with_filter(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.BaseCollectionOnBase).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(6, result.Count); - Assert.Equal( - 3, result.SelectMany(e => e.BaseCollectionOnBase.OfType()).Count(e => e.DerivedProperty != 0)); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseCollectionOnBase).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseCollectionOnBase))); } - [ConditionalFact] - public virtual void Include_collection_with_inheritance_with_filter_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance_with_filter_reverse(bool async) { - using var context = CreateContext(); - var query = context.BaseCollectionsOnBase.Include(e => e.BaseParent).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(13, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseParent).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseParent))); } - [ConditionalFact] - public virtual void Include_collection_without_inheritance() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_without_inheritance(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.CollectionOnBase); - var result = query.ToList(); - - Assert.Equal(6, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.CollectionOnBase), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.CollectionOnBase))); } - [ConditionalFact] - public virtual void Include_collection_without_inheritance_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_without_inheritance_reverse(bool async) { - using var context = CreateContext(); - var query = context.CollectionsOnBase.Include(e => e.Parent); - var result = query.ToList(); - - Assert.Equal(9, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.Parent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.Parent))); } - [ConditionalFact] - public virtual void Include_collection_without_inheritance_with_filter() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_without_inheritance_with_filter(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.CollectionOnBase).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(6, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.CollectionOnBase).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.CollectionOnBase))); } - [ConditionalFact] - public virtual void Include_collection_without_inheritance_with_filter_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_without_inheritance_with_filter_reverse(bool async) { - using var context = CreateContext(); - var query = context.CollectionsOnBase.Include(e => e.Parent).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(9, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.Parent).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.Parent))); } - [ConditionalFact] - public virtual void Include_reference_with_inheritance_on_derived1() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_with_inheritance_on_derived1(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.BaseReferenceOnBase); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseReferenceOnBase), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseReferenceOnBase))); } - [ConditionalFact] - public virtual void Include_reference_with_inheritance_on_derived2() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_with_inheritance_on_derived2(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.BaseReferenceOnDerived); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseReferenceOnDerived), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseReferenceOnDerived))); } - [ConditionalFact] - public virtual void Include_reference_with_inheritance_on_derived4() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_with_inheritance_on_derived4(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.DerivedReferenceOnDerived); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.DerivedReferenceOnDerived), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.DerivedReferenceOnDerived))); } - [ConditionalFact] - public virtual void Include_reference_with_inheritance_on_derived_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_with_inheritance_on_derived_reverse(bool async) { - using var context = CreateContext(); - var query = context.BaseReferencesOnDerived.Include(e => e.BaseParent); - var result = query.ToList(); - - Assert.Equal(6, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseParent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseParent))); } - [ConditionalFact] - public virtual void Include_reference_with_inheritance_on_derived_with_filter1() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_with_inheritance_on_derived_with_filter1(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.BaseReferenceOnBase).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseReferenceOnBase).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseReferenceOnBase))); } - [ConditionalFact] - public virtual void Include_reference_with_inheritance_on_derived_with_filter2() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_with_inheritance_on_derived_with_filter2(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.BaseReferenceOnDerived).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseReferenceOnDerived).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseReferenceOnDerived))); } - [ConditionalFact] - public virtual void Include_reference_with_inheritance_on_derived_with_filter4() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_with_inheritance_on_derived_with_filter4(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.DerivedReferenceOnDerived).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.DerivedReferenceOnDerived).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.DerivedReferenceOnDerived))); } - [ConditionalFact] - public virtual void Include_reference_with_inheritance_on_derived_with_filter_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_with_inheritance_on_derived_with_filter_reverse(bool async) { - using var context = CreateContext(); - var query = context.BaseReferencesOnDerived.Include(e => e.BaseParent).Where(e => e.Name != "Bar"); - var result = query.ToList(); - - Assert.Equal(6, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseParent).Where(e => e.Name != "Bar"), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseParent))); } - [ConditionalFact] - public virtual void Include_reference_without_inheritance_on_derived1() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_without_inheritance_on_derived1(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.ReferenceOnBase); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.ReferenceOnBase), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.ReferenceOnBase))); } - [ConditionalFact] - public virtual void Include_reference_without_inheritance_on_derived2() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_without_inheritance_on_derived2(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.ReferenceOnDerived); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.ReferenceOnDerived), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.ReferenceOnDerived))); } - [ConditionalFact] - public virtual void Include_reference_without_inheritance_on_derived_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_reference_without_inheritance_on_derived_reverse(bool async) { - using var context = CreateContext(); - var query = context.ReferencesOnDerived.Include(e => e.Parent); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.Parent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.Parent))); } - [ConditionalFact] - public virtual void Include_collection_with_inheritance_on_derived1() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance_on_derived1(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.BaseCollectionOnBase); - var result = query.ToList(); - - Assert.Equal(3, result.Count); - Assert.Equal( - 2, result.SelectMany(e => e.BaseCollectionOnBase.OfType()).Count(e => e.DerivedProperty != 0)); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseCollectionOnBase), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseCollectionOnBase))); } - [ConditionalFact] - public virtual void Include_collection_with_inheritance_on_derived2() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance_on_derived2(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.BaseCollectionOnDerived); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseCollectionOnDerived), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseCollectionOnDerived))); } - [ConditionalFact] - public virtual void Include_collection_with_inheritance_on_derived3() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance_on_derived3(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.DerivedCollectionOnDerived); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.DerivedCollectionOnDerived), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.DerivedCollectionOnDerived))); } - [ConditionalFact] - public virtual void Include_collection_with_inheritance_on_derived_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Include_collection_with_inheritance_on_derived_reverse(bool async) { - using var context = CreateContext(); - var query = context.BaseCollectionsOnDerived.Include(e => e.BaseParent); - var result = query.ToList(); - - Assert.Equal(7, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseParent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseParent))); } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_reference_reference() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_reference_reference(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.BaseReferenceOnBase.NestedReference); - var result = query.ToList(); - - Assert.Equal(6, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseReferenceOnBase.NestedReference), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseReferenceOnBase), + new ExpectedInclude(x => x.NestedReference))); } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_reference_reference_on_base() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_reference_reference_on_base(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.BaseReferenceOnBase.NestedReference); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseReferenceOnBase.NestedReference), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseReferenceOnBase), + new ExpectedInclude(x => x.NestedReference))); } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_reference_reference_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_reference_reference_reverse(bool async) { - using var context = CreateContext(); - var query = context.NestedReferences.Include(e => e.ParentReference.BaseParent); - var result = query.ToList(); - - Assert.Equal(9, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.ParentReference.BaseParent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.ParentReference), + new ExpectedInclude(x => x.BaseParent))); } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_reference_collection() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_reference_collection(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.BaseReferenceOnBase.NestedCollection); - var result = query.ToList(); - - Assert.Equal(6, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseReferenceOnBase.NestedCollection), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseReferenceOnBase), + new ExpectedInclude(x => x.NestedCollection))); } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_reference_collection_on_base() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_reference_collection_on_base(bool async) { - using var context = CreateContext(); - var query = context.DerivedEntities.Include(e => e.BaseReferenceOnBase.NestedCollection); - var result = query.ToList(); - - Assert.Equal(3, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseReferenceOnBase.NestedCollection), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseReferenceOnBase), + new ExpectedInclude(x => x.NestedCollection))); } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_reference_collection_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_reference_collection_reverse(bool async) { - using var context = CreateContext(); - var query = context.NestedCollections.Include(e => e.ParentReference.BaseParent); - var result = query.ToList(); - - Assert.Equal(13, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.ParentReference.BaseParent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.ParentReference), + new ExpectedInclude(x => x.BaseParent))); } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_collection_reference() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_collection_reference(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.BaseCollectionOnBase).ThenInclude(e => e.NestedReference); - var result = query.ToList(); - - Assert.Equal(6, result.Count); - Assert.Equal( - 3, result.SelectMany(e => e.BaseCollectionOnBase.OfType()).Count(e => e.DerivedProperty != 0)); - } + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseCollectionOnBase).ThenInclude(e => e.NestedReference), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseCollectionOnBase), + new ExpectedInclude(x => x.NestedReference))); + } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_collection_reference_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_collection_reference_reverse(bool async) { - using var context = CreateContext(); - var query = context.NestedReferences.Include(e => e.ParentCollection.BaseParent); - var result = query.ToList(); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.ParentCollection.BaseParent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.ParentCollection), + new ExpectedInclude(x => x.BaseParent))); + } - Assert.Equal(9, result.Count); - } - - [ConditionalFact] - public virtual void Nested_include_with_inheritance_collection_collection() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_collection_collection(bool async) { - using var context = CreateContext(); - var query = context.BaseEntities.Include(e => e.BaseCollectionOnBase).ThenInclude(e => e.NestedCollection); - var result = query.ToList(); - - Assert.Equal(6, result.Count); - Assert.Equal( - 3, result.SelectMany(e => e.BaseCollectionOnBase.OfType()).Count(e => e.DerivedProperty != 0)); - } + return AssertQuery( + async, + ss => ss.Set().Include(e => e.BaseCollectionOnBase).ThenInclude(e => e.NestedCollection), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.BaseCollectionOnBase), + new ExpectedInclude(x => x.NestedCollection))); + } - [ConditionalFact] - public virtual void Nested_include_with_inheritance_collection_collection_reverse() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_with_inheritance_collection_collection_reverse(bool async) { - using var context = CreateContext(); - var query = context.NestedCollections.Include(e => e.ParentCollection.BaseParent); - var result = query.ToList(); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.ParentCollection.BaseParent), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.ParentCollection), + new ExpectedInclude(x => x.BaseParent))); + } - Assert.Equal(13, result.Count); - } - - [ConditionalFact] - public virtual void Nested_include_collection_reference_on_non_entity_base() + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Nested_include_collection_reference_on_non_entity_base(bool async) { - using var context = CreateContext(); - var query = context.ReferencedEntities.Include(e => e.Principals).ThenInclude(e => e.Reference); - var result = query.ToList(); - - Assert.Equal(2, result.Count); + return AssertQuery( + async, + ss => ss.Set().Include(e => e.Principals).ThenInclude(e => e.Reference), + elementAsserter: (e, a) => AssertInclude(e, a, + new ExpectedInclude(x => x.Principals), + new ExpectedInclude(x => x.Reference))); } protected InheritanceRelationshipsContext CreateContext() => Fixture.CreateContext(); diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/InheritanceRelationshipsContext.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/InheritanceRelationshipsContext.cs deleted file mode 100644 index 4c7e4a3010b..00000000000 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/InheritanceRelationshipsContext.cs +++ /dev/null @@ -1,500 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.TestUtilities; - -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships -{ - public class InheritanceRelationshipsContext : PoolableDbContext - { - public InheritanceRelationshipsContext(DbContextOptions options) - : base(options) - { - } - - public DbSet BaseEntities { get; set; } - public DbSet DerivedEntities { get; set; } - - public DbSet BaseReferencesOnBase { get; set; } - public DbSet BaseReferencesOnDerived { get; set; } - public DbSet ReferencesOnBase { get; set; } - public DbSet ReferencesOnDerived { get; set; } - public DbSet NestedReferences { get; set; } - - public DbSet BaseCollectionsOnBase { get; set; } - public DbSet BaseCollectionsOnDerived { get; set; } - public DbSet CollectionsOnBase { get; set; } - public DbSet CollectionsOnDerived { get; set; } - public DbSet NestedCollections { get; set; } - - public DbSet PrincipalEntities { get; set; } - public DbSet ReferencedEntities { get; set; } - - public static void Seed(InheritanceRelationshipsContext context) - { - var nrb1 = new NestedReferenceBase { Name = "NRB1" }; - var nrb2 = new NestedReferenceBase { Name = "NRB2" }; - var nrb3 = new NestedReferenceBase { Name = "NRB3" }; - var nrb4 = new NestedReferenceBase { Name = "NRB4 (dangling)" }; - - context.NestedReferences.AddRange(nrb1, nrb2, nrb3, nrb4); - - var nrd1 = new NestedReferenceDerived { Name = "NRD1" }; - var nrd2 = new NestedReferenceDerived { Name = "NRD2" }; - var nrd3 = new NestedReferenceDerived { Name = "NRD3" }; - var nrd4 = new NestedReferenceDerived { Name = "NRD4" }; - var nrd5 = new NestedReferenceDerived { Name = "NRD4 (dangling)" }; - - context.NestedReferences.AddRange(nrd1, nrd2, nrd3, nrd5); - - var ncb11 = new NestedCollectionBase { Name = "NCB11" }; - var ncb21 = new NestedCollectionBase { Name = "NCB21" }; - var ncb22 = new NestedCollectionBase { Name = "NCB22" }; - var ncb31 = new NestedCollectionBase { Name = "NCB31" }; - var ncb41 = new NestedCollectionBase { Name = "NCB41 (dangling)" }; - - context.NestedCollections.AddRange(ncb11, ncb21, ncb22, ncb31, ncb41); - - var ncd11 = new NestedCollectionDerived { Name = "NCD11" }; - var ncd21 = new NestedCollectionDerived { Name = "NCD21" }; - var ncd31 = new NestedCollectionDerived { Name = "NCD21" }; - var ncd32 = new NestedCollectionDerived { Name = "NCD32" }; - var ncd41 = new NestedCollectionDerived { Name = "NCD41" }; - var ncd42 = new NestedCollectionDerived { Name = "NCD42" }; - var ncd51 = new NestedCollectionDerived { Name = "NCD52 (dangling)" }; - var ncd52 = new NestedCollectionDerived { Name = "NCD52 (dangling)" }; - - context.NestedCollections.AddRange(ncd11, ncd21, ncd31, ncd32, ncd41, ncd42, ncd51, ncd52); - - var brob1 = new BaseReferenceOnBase - { - Name = "BROB1", - NestedReference = nrb1, - NestedCollection = new List { ncb11 } - }; - var brob2 = new BaseReferenceOnBase - { - Name = "BROB2", - NestedReference = nrd1, - NestedCollection = new List { ncd11 } - }; - var brob3 = new BaseReferenceOnBase { Name = "BROB3 (dangling)" }; - - context.BaseReferencesOnBase.AddRange(brob1, brob2, brob3); - - var drob1 = new DerivedReferenceOnBase - { - Name = "DROB1", - NestedReference = nrb2, - NestedCollection = new List { ncb21, ncb22 } - }; - var drob2 = new DerivedReferenceOnBase - { - Name = "DROB2", - NestedReference = nrd2, - NestedCollection = new List { ncd21 } - }; - var drob3 = new DerivedReferenceOnBase { Name = "DROB3" }; - var drob4 = new DerivedReferenceOnBase - { - Name = "DROB4 (half-dangling)", - NestedReference = nrd3, - NestedCollection = new List { ncd31, ncd32 } - }; - var drob5 = new DerivedReferenceOnBase { Name = "DROB5 (dangling)" }; - - context.BaseReferencesOnBase.AddRange(drob1, drob2, drob3, drob4, drob5); - - var rob1 = new ReferenceOnBase { Name = "ROB1" }; - var rob2 = new ReferenceOnBase { Name = "ROB2" }; - var rob3 = new ReferenceOnBase { Name = "ROB3" }; - var rob4 = new ReferenceOnBase { Name = "ROB4" }; - - context.ReferencesOnBase.AddRange(rob1, rob2, rob3, rob4); - - var bcob11 = new BaseCollectionOnBase - { - Name = "BCOB11", - NestedReference = nrb1, - NestedCollection = new List { ncb11 } - }; - var bcob12 = new BaseCollectionOnBase - { - Name = "BCOB12", - NestedReference = nrd1, - NestedCollection = new List { ncd11 } - }; - var bcob21 = new BaseCollectionOnBase { Name = "BCOB21" }; - var bcob31 = new BaseCollectionOnBase - { - Name = "BCOB31 (dangling)", - NestedReference = nrb2, - NestedCollection = new List { ncb21, ncb22 } - }; - var bcob32 = new BaseCollectionOnBase { Name = "BCOB32 (dangling)" }; - - context.BaseCollectionsOnBase.AddRange(bcob11, bcob12, bcob21, bcob31, bcob32); - - var dcob11 = new DerivedCollectionOnBase - { - Name = "DCOB11", - NestedReference = nrd2, - NestedCollection = new List { ncd21 }, - DerivedProperty = 1 - }; - var dcob12 = new DerivedCollectionOnBase - { - Name = "DCOB12", - NestedReference = nrb3, - NestedCollection = new List { ncb31 }, - DerivedProperty = 2 - }; - var dcob21 = new DerivedCollectionOnBase { Name = "DCOB21", DerivedProperty = 3 }; - var dcob31 = new DerivedCollectionOnBase - { - Name = "DCOB31", - NestedReference = nrd3, - NestedCollection = new List { ncd31, ncd32 }, - DerivedProperty = 4 - }; - var dcob32 = new DerivedCollectionOnBase { Name = "DCOB32", DerivedProperty = 5 }; - var dcob41 = new DerivedCollectionOnBase { Name = "DCOB41", DerivedProperty = 6 }; - var dcob51 = new DerivedCollectionOnBase - { - Name = "DCOB51 (dangling)", - NestedReference = nrd4, - NestedCollection = new List { ncd41, ncd42 }, - DerivedProperty = 7 - }; - var dcob52 = new DerivedCollectionOnBase { Name = "DCOB52 (dangling)", DerivedProperty = 8 }; - - context.BaseCollectionsOnBase.AddRange(dcob11, dcob12, dcob21, dcob31, dcob32, dcob41, dcob51, dcob52); - - var cob11 = new CollectionOnBase { Name = "COB11" }; - var cob12 = new CollectionOnBase { Name = "COB12" }; - var cob21 = new CollectionOnBase { Name = "COB21" }; - var cob31 = new CollectionOnBase { Name = "COB31" }; - var cob32 = new CollectionOnBase { Name = "COB32" }; - var cob33 = new CollectionOnBase { Name = "COB33" }; - var cob41 = new CollectionOnBase { Name = "COB41" }; - var cob51 = new CollectionOnBase { Name = "COB51 (dangling)" }; - var cob52 = new CollectionOnBase { Name = "COB52 (dangling)" }; - - context.CollectionsOnBase.AddRange(cob11, cob12, cob21, cob31, cob32, cob33, cob41, cob51, cob52); - - var brod1 = new BaseReferenceOnDerived { Name = "BROD1" }; - var brod2 = new BaseReferenceOnDerived { Name = "BROD2 (dangling)" }; - var brod3 = new BaseReferenceOnDerived { Name = "BROD3 (dangling)" }; - - context.BaseReferencesOnDerived.AddRange(brod1, brod2, brod3); - - var drod1 = new DerivedReferenceOnDerived { Name = "DROD1" }; - var drod2 = new DerivedReferenceOnDerived { Name = "DROD2" }; - var drod3 = new DerivedReferenceOnDerived { Name = "DROD3 (dangling)" }; - - context.BaseReferencesOnDerived.AddRange(drod1, drod2, drod3); - - var rod1 = new ReferenceOnDerived { Name = "ROD1" }; - var rod2 = new ReferenceOnDerived { Name = "ROD2" }; - var rod3 = new ReferenceOnDerived { Name = "ROD3 (dangling)" }; - - context.ReferencesOnDerived.AddRange(rod1, rod2, rod3); - - var bcod11 = new BaseCollectionOnDerived { Name = "BCOD11" }; - var bcod21 = new BaseCollectionOnDerived { Name = "BCOD21 (dangling)" }; - var bcod22 = new BaseCollectionOnDerived { Name = "BCOD22 (dangling)" }; - - context.BaseCollectionsOnDerived.AddRange(bcod11, bcod21, bcod22); - - var dcod11 = new DerivedCollectionOnDerived { Name = "DCOD11" }; - var dcod12 = new DerivedCollectionOnDerived { Name = "DCOD12" }; - var dcod21 = new DerivedCollectionOnDerived { Name = "DCOD21" }; - var dcod31 = new DerivedCollectionOnDerived { Name = "DCOD31 (dangling)" }; - - context.BaseCollectionsOnDerived.AddRange(dcod11, dcod12, dcod21, dcod31); - - var cod11 = new CollectionOnDerived { Name = "COD11" }; - var cod21 = new CollectionOnDerived { Name = "COD21" }; - var cod22 = new CollectionOnDerived { Name = "COD22" }; - var cod31 = new CollectionOnDerived { Name = "COD31 (dangling)" }; - - context.CollectionsOnDerived.AddRange(cod11, cod21, cod22, cod31); - - var baseEntity1 = new BaseInheritanceRelationshipEntity - { - Name = "Base1", - BaseReferenceOnBase = brob1, - ReferenceOnBase = rob1, - BaseCollectionOnBase = new List { bcob11 }, - CollectionOnBase = new List { cob11, cob12 }, - OwnedReferenceOnBase = new OwnedEntity - { - Name = "OROB1" - }, - OwnedCollectionOnBase = new List{ - new OwnedEntity - { - Id = 1, - Name = "OCOB11" - }, new OwnedEntity - { - Id = 2, - Name = "OCOB12" - }} - }; - - var baseEntity2 = new BaseInheritanceRelationshipEntity - { - Name = "Base2", - BaseReferenceOnBase = drob2, - ReferenceOnBase = rob2, - CollectionOnBase = new List { cob21 }, - OwnedReferenceOnBase = new OwnedEntity - { - Name = "OROB2" - }, - OwnedCollectionOnBase = new List{ - new OwnedEntity - { - Id = 3, - Name = "OCOB21" - }} - }; - - var baseEntity3 = new BaseInheritanceRelationshipEntity - { - Name = "Base3", - BaseCollectionOnBase = new List { dcob21 } - }; - - context.BaseEntities.AddRange(baseEntity1, baseEntity2, baseEntity3); - - var derivedEntity1 = new DerivedInheritanceRelationshipEntity - { - Name = "Derived1(4)", - BaseSelfReferenceOnDerived = baseEntity1, - BaseReferenceOnBase = drob1, - ReferenceOnBase = rob3, - BaseCollectionOnBase = new List { dcob11, dcob12 }, - CollectionOnBase = new List { cob31, cob32 }, - BaseReferenceOnDerived = brod1, - DerivedReferenceOnDerived = drod1, - ReferenceOnDerived = rod1, - BaseCollectionOnDerived = new List { bcod11 }, - DerivedCollectionOnDerived = new List { dcod11, dcod12 }, - CollectionOnDerived = new List { cod11 }, - OwnedReferenceOnBase = new OwnedEntity - { - Name = "OROB4" - }, - OwnedCollectionOnBase = new List{ - new OwnedEntity - { - Id = 4, - Name = "OCOB41" - }, new OwnedEntity - { - Id = 5, - Name = "OCOB42" - }}, - OwnedReferenceOnDerived = new OwnedEntity - { - Name = "OROD4" - }, - OwnedCollectionOnDerived = new List{ - new OwnedEntity - { - Id = 1, - Name = "OCOD41" - }, new OwnedEntity - { - Id = 2, - Name = "OCOD42" - }} - }; - - var derivedEntity2 = new DerivedInheritanceRelationshipEntity - { - Name = "Derived2(5)", - BaseSelfReferenceOnDerived = baseEntity2, - ReferenceOnBase = rob4, - BaseReferenceOnBase = brob2, - CollectionOnBase = new List { cob41 }, - BaseReferenceOnDerived = drod2, - ReferenceOnDerived = rod2, - CollectionOnDerived = new List { cod21, cod22 }, - OwnedReferenceOnBase = new OwnedEntity - { - Name = "OROB5" - }, - OwnedCollectionOnBase = new List{ - new OwnedEntity - { - Id = 6, - Name = "OCOB51" - }}, - OwnedReferenceOnDerived = new OwnedEntity - { - Name = "OROD5" - }, - OwnedCollectionOnDerived = new List{ - new OwnedEntity - { - Id = 3, - Name = "OCOD51" - }} - }; - - var derivedEntity3 = new DerivedInheritanceRelationshipEntity - { - Name = "Derived3(6)", - BaseSelfReferenceOnDerived = baseEntity3, - BaseCollectionOnBase = new List { bcob21 }, - DerivedReferenceOnDerived = drod2, - BaseCollectionOnDerived = new List { dcod11, dcod12 }, - DerivedCollectionOnDerived = new List { dcod21 } - }; - - context.BaseEntities.AddRange(derivedEntity1, derivedEntity2, derivedEntity3); - - baseEntity1.DerivedSefReferenceOnBase = derivedEntity1; - baseEntity2.DerivedSefReferenceOnBase = derivedEntity2; - baseEntity3.DerivedSefReferenceOnBase = derivedEntity3; - - var principalEntity1 = new PrincipalEntity { Name = "PE1" }; - var principalEntity2 = new PrincipalEntity { Name = "PE2" }; - - context.PrincipalEntities.AddRange(principalEntity1, principalEntity2); - - var referencedEntity1 = new ReferencedEntity { Name = "RE1", Principals = new List { principalEntity1 } }; - var referencedEntity2 = new ReferencedEntity { Name = "RE2", Principals = new List { principalEntity2 } }; - - context.ReferencedEntities.AddRange(referencedEntity1, referencedEntity2); - - principalEntity2.Reference = referencedEntity1; - principalEntity1.Reference = referencedEntity2; - - context.SaveChanges(); - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.Owned(); - modelBuilder.Entity(); - modelBuilder.Entity(); - modelBuilder.Entity(); - modelBuilder.Entity(); - modelBuilder.Entity(); - modelBuilder.Entity(); - - modelBuilder.Entity() - .HasOne(e => e.DerivedSefReferenceOnBase) - .WithOne(e => e.BaseSelfReferenceOnDerived) - .HasForeignKey(e => e.BaseId) - .IsRequired(false); - - modelBuilder.Entity() - .HasOne(e => e.BaseReferenceOnBase) - .WithOne(e => e.BaseParent) - .HasForeignKey(e => e.BaseParentId) - .IsRequired(false); - - modelBuilder.Entity() - .HasOne(e => e.ReferenceOnBase) - .WithOne(e => e.Parent) - .HasForeignKey(e => e.ParentId) - .IsRequired(false); - - modelBuilder.Entity() - .HasMany(e => e.BaseCollectionOnBase) - .WithOne(e => e.BaseParent) - .HasForeignKey(e => e.BaseParentId) - .IsRequired(false); - - modelBuilder.Entity() - .HasMany(e => e.CollectionOnBase) - .WithOne(e => e.Parent) - .HasForeignKey(e => e.ParentId) - .IsRequired(false); - - modelBuilder.Entity() - .OwnsMany(e => e.OwnedCollectionOnBase) - .Property(e => e.Id).ValueGeneratedNever(); - - modelBuilder.Entity() - .HasOne(e => e.DerivedReferenceOnDerived) - .WithOne() - .HasForeignKey("DerivedInheritanceRelationshipEntityId") - .IsRequired(false); - - modelBuilder.Entity() - .HasOne(e => e.ReferenceOnDerived) - .WithOne(e => e.Parent) - .HasForeignKey(e => e.ParentId) - .IsRequired(false); - - modelBuilder.Entity() - .HasMany(e => e.BaseCollectionOnDerived) - .WithOne(e => e.BaseParent) - .HasForeignKey(e => e.ParentId) - .IsRequired(false); - - modelBuilder.Entity() - .HasMany(e => e.CollectionOnDerived) - .WithOne(e => e.Parent) - .HasForeignKey(e => e.ParentId) - .IsRequired(false); - - modelBuilder.Entity() - .HasMany(e => e.DerivedCollectionOnDerived) - .WithOne() - .HasForeignKey("DerivedInheritanceRelationshipEntityId") - .IsRequired(false); - - modelBuilder.Entity() - .HasOne(e => e.BaseReferenceOnDerived) - .WithOne(e => e.BaseParent) - .HasForeignKey(e => e.BaseParentId) - .IsRequired(false); - - modelBuilder.Entity() - .OwnsMany(e => e.OwnedCollectionOnDerived) - .Property(e => e.Id).ValueGeneratedNever(); - - modelBuilder.Entity() - .HasOne(e => e.NestedReference) - .WithOne(e => e.ParentReference) - .HasForeignKey(e => e.ParentReferenceId) - .IsRequired(false); - - modelBuilder.Entity() - .HasMany(e => e.NestedCollection) - .WithOne(e => e.ParentReference) - .HasForeignKey(e => e.ParentReferenceId) - .IsRequired(false); - - modelBuilder.Entity() - .HasOne(e => e.NestedReference) - .WithOne(e => e.ParentCollection) - .HasForeignKey(e => e.ParentCollectionId) - .IsRequired(false); - - modelBuilder.Entity() - .HasMany(e => e.NestedCollection) - .WithOne(e => e.ParentCollection) - .HasForeignKey(e => e.ParentCollectionId) - .IsRequired(false); - - modelBuilder.Entity() - .HasOne(e => e.Reference) - .WithMany() - .IsRequired(false); - - modelBuilder.Entity() - .HasMany(e => e.Principals) - .WithOne() - .IsRequired(false); - } - } -} diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/BaseCollectionOnBase.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/BaseCollectionOnBase.cs similarity index 97% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/BaseCollectionOnBase.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/BaseCollectionOnBase.cs index 9cc510f0b2a..254ec1d7ff4 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/BaseCollectionOnBase.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/BaseCollectionOnBase.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class BaseCollectionOnBase { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/BaseCollectionOnDerived.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/BaseCollectionOnDerived.cs similarity index 96% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/BaseCollectionOnDerived.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/BaseCollectionOnDerived.cs index 01c301dfb06..c9cd468743f 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/BaseCollectionOnDerived.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/BaseCollectionOnDerived.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class BaseCollectionOnDerived { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/BaseInheritanceRelationshipEntity.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/BaseInheritanceRelationshipEntity.cs similarity index 98% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/BaseInheritanceRelationshipEntity.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/BaseInheritanceRelationshipEntity.cs index 891e1fabca2..a936d883c31 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/BaseInheritanceRelationshipEntity.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/BaseInheritanceRelationshipEntity.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class BaseInheritanceRelationshipEntity { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/BaseReferenceOnBase.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/BaseReferenceOnBase.cs similarity index 97% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/BaseReferenceOnBase.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/BaseReferenceOnBase.cs index 0afa95307f3..c23536bd572 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/BaseReferenceOnBase.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/BaseReferenceOnBase.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class BaseReferenceOnBase { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/BaseReferenceOnDerived.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/BaseReferenceOnDerived.cs similarity index 96% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/BaseReferenceOnDerived.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/BaseReferenceOnDerived.cs index c21699a225d..bc1d93b5193 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/BaseReferenceOnDerived.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/BaseReferenceOnDerived.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class BaseReferenceOnDerived { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/CollectionOnBase.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/CollectionOnBase.cs similarity index 96% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/CollectionOnBase.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/CollectionOnBase.cs index e21ba913f89..2e3525f038a 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/CollectionOnBase.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/CollectionOnBase.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class CollectionOnBase { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/CollectionOnDerived.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/CollectionOnDerived.cs similarity index 96% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/CollectionOnDerived.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/CollectionOnDerived.cs index 49808cfeaf5..893e808080f 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/CollectionOnDerived.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/CollectionOnDerived.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class CollectionOnDerived { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/DerivedCollectionOnBase.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/DerivedCollectionOnBase.cs similarity index 95% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/DerivedCollectionOnBase.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/DerivedCollectionOnBase.cs index 2a2b3912648..148db255165 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/DerivedCollectionOnBase.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/DerivedCollectionOnBase.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class DerivedCollectionOnBase : BaseCollectionOnBase { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/DerivedCollectionOnDerived.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/DerivedCollectionOnDerived.cs similarity index 94% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/DerivedCollectionOnDerived.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/DerivedCollectionOnDerived.cs index ab02ec8e396..9f3c9f954c4 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/DerivedCollectionOnDerived.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/DerivedCollectionOnDerived.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class DerivedCollectionOnDerived : BaseCollectionOnDerived { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/DerivedInheritanceRelationshipEntity.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/DerivedInheritanceRelationshipEntity.cs similarity index 98% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/DerivedInheritanceRelationshipEntity.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/DerivedInheritanceRelationshipEntity.cs index 87cdf2c38ef..db843bcf971 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/DerivedInheritanceRelationshipEntity.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/DerivedInheritanceRelationshipEntity.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class DerivedInheritanceRelationshipEntity : BaseInheritanceRelationshipEntity { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/DerivedReferenceOnBase.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/DerivedReferenceOnBase.cs similarity index 94% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/DerivedReferenceOnBase.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/DerivedReferenceOnBase.cs index 556d651ad51..9e72bdd485c 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/DerivedReferenceOnBase.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/DerivedReferenceOnBase.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class DerivedReferenceOnBase : BaseReferenceOnBase { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/DerivedReferenceOnDerived.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/DerivedReferenceOnDerived.cs similarity index 94% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/DerivedReferenceOnDerived.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/DerivedReferenceOnDerived.cs index 8c6960b04b6..b4a0d4dee9d 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/DerivedReferenceOnDerived.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/DerivedReferenceOnDerived.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class DerivedReferenceOnDerived : BaseReferenceOnDerived { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/InheritanceRelationshipsContext.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/InheritanceRelationshipsContext.cs new file mode 100644 index 00000000000..b349d291cf3 --- /dev/null +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/InheritanceRelationshipsContext.cs @@ -0,0 +1,77 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using Microsoft.EntityFrameworkCore.TestUtilities; + +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel +{ + public class InheritanceRelationshipsContext : PoolableDbContext + { + public static readonly string StoreName = "InheritanceRelationships"; + + public InheritanceRelationshipsContext(DbContextOptions options) + : base(options) + { + } + + public DbSet BaseCollectionsOnBase { get; set; } + public DbSet BaseCollectionsOnDerived { get; set; } + public DbSet BaseEntities { get; set; } + public DbSet BaseReferencesOnBase { get; set; } + public DbSet BaseReferencesOnDerived { get; set; } + public DbSet CollectionsOnBase { get; set; } + public DbSet CollectionsOnDerived { get; set; } + public DbSet NestedCollections { get; set; } + public DbSet NestedReferences { get; set; } + public DbSet PrincipalEntities { get; set; } + public DbSet ReferencedEntities { get; set; } + public DbSet ReferencesOnBase { get; set; } + public DbSet ReferencesOnDerived { get; set; } + + public static void Seed(InheritanceRelationshipsContext context) + { + var baseCollectionsOnBase = InheritanceRelationshipsData.CreateBaseCollectionsOnBase(); + var baseCollectionsOnDerived = InheritanceRelationshipsData.CreateBaseCollectionsOnDerived(); + var baseEntities = InheritanceRelationshipsData.CreateBaseEntities(); + var baseReferencesOnBase = InheritanceRelationshipsData.CreateBaseReferencesOnBase(); + var baseReferencesOnDerived = InheritanceRelationshipsData.CreateBaseReferencesOnDerived(); + var collectionsOnBase = InheritanceRelationshipsData.CreateCollectionsOnBase(); + var collectionsOnDerived = InheritanceRelationshipsData.CreateCollectionsOnDerived(); + var nestedCollections = InheritanceRelationshipsData.CreateNestedCollections(); + var nestedReferences = InheritanceRelationshipsData.CreateNestedReferences(); + var principalEntities = InheritanceRelationshipsData.CreatePrincipalEntities(); + var referencedEntities = InheritanceRelationshipsData.CreateReferencedEntities(); + var referencesOnBase = InheritanceRelationshipsData.CreateReferencesOnBase(); + var referencesOnDerived = InheritanceRelationshipsData.CreateReferencesOnDerived(); + + InheritanceRelationshipsData.WireUp( + baseEntities, + baseReferencesOnBase, + baseReferencesOnDerived, + referencesOnBase, + referencesOnDerived, + nestedReferences, + baseCollectionsOnBase, + baseCollectionsOnDerived, + collectionsOnBase, + collectionsOnDerived, + nestedCollections); + + context.BaseCollectionsOnBase.AddRange(baseCollectionsOnBase); + context.BaseCollectionsOnDerived.AddRange(baseCollectionsOnDerived); + context.BaseEntities.AddRange(baseEntities); + context.BaseReferencesOnBase.AddRange(baseReferencesOnBase); + context.BaseReferencesOnDerived.AddRange(baseReferencesOnDerived); + context.CollectionsOnBase.AddRange(collectionsOnBase); + context.CollectionsOnDerived.AddRange(collectionsOnDerived); + context.NestedCollections.AddRange(nestedCollections); + context.NestedReferences.AddRange(nestedReferences); + context.PrincipalEntities.AddRange(principalEntities); + context.ReferencedEntities.AddRange(referencedEntities); + context.ReferencesOnBase.AddRange(referencesOnBase); + context.ReferencesOnDerived.AddRange(referencesOnDerived); + + context.SaveChanges(); + } + } +} diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/InheritanceRelationshipsData.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/InheritanceRelationshipsData.cs new file mode 100644 index 00000000000..ca3a53ae389 --- /dev/null +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/InheritanceRelationshipsData.cs @@ -0,0 +1,576 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.EntityFrameworkCore.TestUtilities; + +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel +{ + public class InheritanceRelationshipsData : ISetSource + { + public IReadOnlyList BaseEntities { get; set; } + public IReadOnlyList BaseReferencesOnBase { get; set; } + public IReadOnlyList BaseReferencesOnDerived { get; set; } + public IReadOnlyList ReferencesOnBase { get; set; } + public IReadOnlyList ReferencesOnDerived { get; set; } + public IReadOnlyList NestedReferences { get; set; } + public IReadOnlyList BaseCollectionsOnBase { get; set; } + public IReadOnlyList BaseCollectionsOnDerived { get; set; } + public IReadOnlyList CollectionsOnBase { get; set; } + public IReadOnlyList CollectionsOnDerived { get; set; } + public IReadOnlyList NestedCollections { get; set; } + public IReadOnlyList PrincipalEntities { get; set; } + public IReadOnlyList ReferencedEntities { get; set; } + + public InheritanceRelationshipsData() + { + BaseEntities = CreateBaseEntities(); + BaseReferencesOnBase = CreateBaseReferencesOnBase(); + BaseReferencesOnDerived = CreateBaseReferencesOnDerived(); + ReferencesOnBase = CreateReferencesOnBase(); + ReferencesOnDerived = CreateReferencesOnDerived(); + NestedReferences = CreateNestedReferences(); + BaseCollectionsOnBase = CreateBaseCollectionsOnBase(); + BaseCollectionsOnDerived = CreateBaseCollectionsOnDerived(); + CollectionsOnBase = CreateCollectionsOnBase(); + CollectionsOnDerived = CreateCollectionsOnDerived(); + NestedCollections = CreateNestedCollections(); + PrincipalEntities = CreatePrincipalEntities(); + ReferencedEntities = CreateReferencedEntities(); + + WireUp( + BaseEntities, + BaseReferencesOnBase, + BaseReferencesOnDerived, + ReferencesOnBase, + ReferencesOnDerived, + NestedReferences, + BaseCollectionsOnBase, + BaseCollectionsOnDerived, + CollectionsOnBase, + CollectionsOnDerived, + NestedCollections); + } + + public virtual IQueryable Set() + where TEntity : class + { + if (typeof(TEntity) == typeof(BaseInheritanceRelationshipEntity)) + { + return (IQueryable)BaseEntities.AsQueryable(); + } + + if (typeof(TEntity) == typeof(DerivedInheritanceRelationshipEntity)) + { + return (IQueryable)BaseEntities.OfType().AsQueryable(); + } + + if (typeof(TEntity) == typeof(BaseReferenceOnBase)) + { + return (IQueryable)BaseReferencesOnBase.AsQueryable(); + } + + if (typeof(TEntity) == typeof(BaseReferenceOnDerived)) + { + return (IQueryable)BaseReferencesOnDerived.AsQueryable(); + } + + if (typeof(TEntity) == typeof(ReferenceOnBase)) + { + return (IQueryable)ReferencesOnBase.AsQueryable(); + } + + if (typeof(TEntity) == typeof(ReferenceOnDerived)) + { + return (IQueryable)ReferencesOnDerived.AsQueryable(); + } + + if (typeof(TEntity) == typeof(NestedReferenceBase)) + { + return (IQueryable)NestedReferences.AsQueryable(); + } + + if (typeof(TEntity) == typeof(BaseCollectionOnBase)) + { + return (IQueryable)BaseCollectionsOnBase.AsQueryable(); + } + + if (typeof(TEntity) == typeof(BaseCollectionOnDerived)) + { + return (IQueryable)BaseCollectionsOnDerived.AsQueryable(); + } + + if (typeof(TEntity) == typeof(CollectionOnBase)) + { + return (IQueryable)CollectionsOnBase.AsQueryable(); + } + + if (typeof(TEntity) == typeof(CollectionOnDerived)) + { + return (IQueryable)CollectionsOnDerived.AsQueryable(); + } + + if (typeof(TEntity) == typeof(NestedCollectionBase)) + { + return (IQueryable)NestedCollections.AsQueryable(); + } + + if (typeof(TEntity) == typeof(PrincipalEntity)) + { + return (IQueryable)PrincipalEntities.AsQueryable(); + } + + if (typeof(TEntity) == typeof(ReferencedEntity)) + { + return (IQueryable)ReferencedEntities.AsQueryable(); + } + + throw new InvalidOperationException("Invalid entity type: " + typeof(TEntity)); + } + + public static IReadOnlyList CreateBaseEntities() + => new List + { + new BaseInheritanceRelationshipEntity + { + Id = 1, + Name = "Base1", + OwnedReferenceOnBase = new OwnedEntity { Name = "OROB1" }, + OwnedCollectionOnBase = new List + { + new OwnedEntity { Id = 1, Name = "OCOB11" }, + new OwnedEntity { Id = 2, Name = "OCOB12" } + }, + BaseCollectionOnBase = new List(), + CollectionOnBase = new List(), + }, + new BaseInheritanceRelationshipEntity + { + Id = 2, + Name = "Base2", + OwnedReferenceOnBase = new OwnedEntity { Name = "OROB2" }, + OwnedCollectionOnBase = new List + { + new OwnedEntity { Id = 3, Name = "OCOB21" } + }, + BaseCollectionOnBase = new List(), + CollectionOnBase = new List(), + }, + new BaseInheritanceRelationshipEntity + { + Id = 3, + Name = "Base3", + BaseCollectionOnBase = new List(), + CollectionOnBase = new List(), + OwnedCollectionOnBase = new List(), + }, + new DerivedInheritanceRelationshipEntity + { + Id = 4, + Name = "Derived1(4)", + OwnedReferenceOnBase = new OwnedEntity { Name = "OROB4" }, + OwnedCollectionOnBase = new List + { + new OwnedEntity { Id = 4, Name = "OCOB41" }, + new OwnedEntity { Id = 5, Name = "OCOB42" } + }, + OwnedReferenceOnDerived = new OwnedEntity { Name = "OROD4" }, + OwnedCollectionOnDerived = new List + { + new OwnedEntity { Id = 1, Name = "OCOD41" }, + new OwnedEntity { Id = 2, Name = "OCOD42" } + }, + BaseCollectionOnBase = new List(), + BaseCollectionOnDerived = new List(), + CollectionOnBase = new List(), + CollectionOnDerived = new List(), + DerivedCollectionOnDerived = new List(), + }, + new DerivedInheritanceRelationshipEntity + { + Id = 5, + Name = "Derived2(5)", + OwnedReferenceOnBase = new OwnedEntity { Name = "OROB5" }, + OwnedCollectionOnBase = new List + { + new OwnedEntity { Id = 6, Name = "OCOB51" } + }, + OwnedReferenceOnDerived = new OwnedEntity { Name = "OROD5" }, + OwnedCollectionOnDerived = new List + { + new OwnedEntity { Id = 3, Name = "OCOD51" } + }, + BaseCollectionOnBase = new List(), + BaseCollectionOnDerived = new List(), + CollectionOnBase = new List(), + CollectionOnDerived = new List(), + DerivedCollectionOnDerived = new List(), + }, + new DerivedInheritanceRelationshipEntity + { + Id = 6, + Name = "Derived3(6)", + BaseCollectionOnBase = new List(), + BaseCollectionOnDerived = new List(), + CollectionOnBase = new List(), + CollectionOnDerived = new List(), + DerivedCollectionOnDerived = new List(), + OwnedCollectionOnBase = new List(), + OwnedCollectionOnDerived = new List(), + }, + }; + + public static IReadOnlyList CreateBaseReferencesOnBase() + => new List + { + new BaseReferenceOnBase { Id = 1, Name = "BROB1", NestedCollection = new List() }, + new BaseReferenceOnBase { Id = 2, Name = "BROB2", NestedCollection = new List() }, + new BaseReferenceOnBase { Id = 3, Name = "BROB3 (dangling)", NestedCollection = new List() }, + new DerivedReferenceOnBase { Id = 4, Name = "DROB1", NestedCollection = new List() }, + new DerivedReferenceOnBase { Id = 5, Name = "DROB2", NestedCollection = new List() }, + new DerivedReferenceOnBase { Id = 6, Name = "DROB3", NestedCollection = new List() }, + new DerivedReferenceOnBase { Id = 7, Name = "DROB4 (half-dangling)", NestedCollection = new List() }, + new DerivedReferenceOnBase { Id = 8, Name = "DROB5 (dangling)", NestedCollection = new List() }, + }; + + public static IReadOnlyList CreateBaseReferencesOnDerived() + => new List + { + new BaseReferenceOnDerived { Id = 1, Name = "BROD1" }, + new BaseReferenceOnDerived { Id = 2, Name = "BROD2 (dangling)" }, + new BaseReferenceOnDerived { Id = 3, Name = "BROD3 (dangling)" }, + new DerivedReferenceOnDerived { Id = 4, Name = "DROD1" }, + new DerivedReferenceOnDerived { Id = 5, Name = "DROD2" }, + new DerivedReferenceOnDerived { Id = 6, Name = "DROD3 (dangling)" }, + }; + + public static IReadOnlyList CreateReferencesOnBase() + => new List + { + new ReferenceOnBase { Id = 1, Name = "ROB1" }, + new ReferenceOnBase { Id = 2, Name = "ROB2" }, + new ReferenceOnBase { Id = 3, Name = "ROB3" }, + new ReferenceOnBase { Id = 4, Name = "ROB4" }, + }; + + public static IReadOnlyList CreateReferencesOnDerived() + => new List + { + new ReferenceOnDerived { Id = 1, Name = "ROD1" }, + new ReferenceOnDerived { Id = 2, Name = "ROD2" }, + new ReferenceOnDerived { Id = 3, Name = "ROD3 (dangling)" }, + }; + + public static IReadOnlyList CreateNestedReferences() + => new List + { + new NestedReferenceBase { Id = 1, Name = "NRB1" }, + new NestedReferenceBase { Id = 2, Name = "NRB2" }, + new NestedReferenceBase { Id = 3, Name = "NRB3" }, + new NestedReferenceBase { Id = 4, Name = "NRB4 (dangling)" }, + new NestedReferenceDerived { Id = 5, Name = "NRD1" }, + new NestedReferenceDerived { Id = 6, Name = "NRD2" }, + new NestedReferenceDerived { Id = 7, Name = "NRD3" }, + new NestedReferenceDerived { Id = 8, Name = "NRD4" }, + new NestedReferenceDerived { Id = 9, Name = "NRD4 (dangling)" }, + }; + + public static IReadOnlyList CreateBaseCollectionsOnBase() + => new List + { + new BaseCollectionOnBase { Id = 1, Name = "BCOB11", NestedCollection = new List() }, + new BaseCollectionOnBase { Id = 2, Name = "BCOB12", NestedCollection = new List() }, + new BaseCollectionOnBase { Id = 3, Name = "BCOB21", NestedCollection = new List() }, + new BaseCollectionOnBase { Id = 4, Name = "BCOB31 (dangling)", NestedCollection = new List() }, + new BaseCollectionOnBase { Id = 5, Name = "BCOB32 (dangling)", NestedCollection = new List() }, + new DerivedCollectionOnBase { Id = 6, Name = "DCOB11", DerivedProperty = 1, NestedCollection = new List() }, + new DerivedCollectionOnBase { Id = 7, Name = "DCOB12", DerivedProperty = 2, NestedCollection = new List() }, + new DerivedCollectionOnBase { Id = 8, Name = "DCOB21", DerivedProperty = 3, NestedCollection = new List() }, + new DerivedCollectionOnBase { Id = 9, Name = "DCOB31", DerivedProperty = 4, NestedCollection = new List() }, + new DerivedCollectionOnBase { Id = 10, Name = "DCOB32", DerivedProperty = 5, NestedCollection = new List() }, + new DerivedCollectionOnBase { Id = 11, Name = "DCOB41", DerivedProperty = 6, NestedCollection = new List() }, + new DerivedCollectionOnBase { Id = 12, Name = "DCOB51 (dangling)", DerivedProperty = 7, NestedCollection = new List() }, + new DerivedCollectionOnBase { Id = 13, Name = "DCOB52 (dangling)", DerivedProperty = 8, NestedCollection = new List() }, + }; + + public static IReadOnlyList CreateBaseCollectionsOnDerived() + => new List + { + new BaseCollectionOnDerived { Id = 1, Name = "BCOD11" }, + new BaseCollectionOnDerived { Id = 2, Name = "BCOD21 (dangling)" }, + new BaseCollectionOnDerived { Id = 3, Name = "BCOD22 (dangling)" }, + new DerivedCollectionOnDerived { Id = 4, Name = "DCOD11" }, + new DerivedCollectionOnDerived { Id = 5, Name = "DCOD12" }, + new DerivedCollectionOnDerived { Id = 6, Name = "DCOD21" }, + new DerivedCollectionOnDerived { Id = 7, Name = "DCOD31 (dangling)" }, + }; + + public static IReadOnlyList CreateCollectionsOnBase() + => new List + { + new CollectionOnBase { Id = 1, Name = "COB11" }, + new CollectionOnBase { Id = 2, Name = "COB12" }, + new CollectionOnBase { Id = 3, Name = "COB21" }, + new CollectionOnBase { Id = 4, Name = "COB31" }, + new CollectionOnBase { Id = 5, Name = "COB32" }, + new CollectionOnBase { Id = 6, Name = "COB33" }, + new CollectionOnBase { Id = 7, Name = "COB41" }, + new CollectionOnBase { Id = 8, Name = "COB51 (dangling)" }, + new CollectionOnBase { Id = 9, Name = "COB52 (dangling)" }, + }; + + public static IReadOnlyList CreateCollectionsOnDerived() + => new List + { + new CollectionOnDerived { Id = 1, Name = "COD11" }, + new CollectionOnDerived { Id = 2, Name = "COD21" }, + new CollectionOnDerived { Id = 3, Name = "COD22" }, + new CollectionOnDerived { Id = 4, Name = "COD31 (dangling)" }, + }; + + public static IReadOnlyList CreateNestedCollections() + => new List + { + new NestedCollectionBase { Id = 1, Name = "NCB11" }, + new NestedCollectionBase { Id = 2, Name = "NCB21" }, + new NestedCollectionBase { Id = 3, Name = "NCB22" }, + new NestedCollectionBase { Id = 4, Name = "NCB31" }, + new NestedCollectionBase { Id = 5, Name = "NCB41 (dangling)" }, + new NestedCollectionDerived { Id = 6, Name = "NCD11" }, + new NestedCollectionDerived { Id = 7, Name = "NCD21" }, + new NestedCollectionDerived { Id = 8, Name = "NCD21" }, + new NestedCollectionDerived { Id = 9, Name = "NCD32" }, + new NestedCollectionDerived { Id = 10, Name = "NCD41" }, + new NestedCollectionDerived { Id = 11, Name = "NCD42" }, + new NestedCollectionDerived { Id = 12, Name = "NCD52 (dangling)" }, + new NestedCollectionDerived { Id = 13, Name = "NCD52 (dangling)" }, + }; + + public static IReadOnlyList CreatePrincipalEntities() + => new List + { + new PrincipalEntity { Id = 1, Name = "PE1" }, + new PrincipalEntity { Id = 2, Name = "PE2" }, + }; + + public static IReadOnlyList CreateReferencedEntities() + => new List + { + new ReferencedEntity { Id = 1, Name = "RE1", Principals = new List() }, + new ReferencedEntity { Id = 2, Name = "RE2", Principals = new List() }, + }; + + public static void WireUp( + IReadOnlyList baseEntities, + IReadOnlyList baseReferencesOnBase, + IReadOnlyList baseReferencesOnDerived, + IReadOnlyList referencesOnBase, + IReadOnlyList referencesOnDerived, + IReadOnlyList nestedReferences, + IReadOnlyList baseCollectionsOnBase, + IReadOnlyList baseCollectionsOnDerived, + IReadOnlyList collectionsOnBase, + IReadOnlyList collectionsOnDerived, + IReadOnlyList nestedCollections) + { + // BaseReferenceOnBase.NestedReference (inverse: ParentReference) + // BaseReferenceOnBase.NestedCollection (inverse: ParentReference) + baseReferencesOnBase[0].NestedReference = nestedReferences[0]; + nestedReferences[0].ParentReference = baseReferencesOnBase[0]; + nestedReferences[0].ParentReferenceId = baseReferencesOnBase[0].Id; + + baseReferencesOnBase[0].NestedCollection = new List { nestedCollections[0] }; + nestedCollections[0].ParentReference = baseReferencesOnBase[0]; + nestedCollections[0].ParentReferenceId = baseReferencesOnBase[0].Id; + + baseReferencesOnBase[1].NestedReference = nestedReferences[4]; + nestedReferences[4].ParentReference = baseReferencesOnBase[1]; + nestedReferences[4].ParentReferenceId = baseReferencesOnBase[1].Id; + + baseReferencesOnBase[1].NestedCollection = new List { nestedCollections[5] }; + nestedCollections[5].ParentReference = baseReferencesOnBase[1]; + nestedCollections[5].ParentReferenceId = baseReferencesOnBase[1].Id; + + baseReferencesOnBase[3].NestedReference = nestedReferences[1]; + nestedReferences[1].ParentReference = baseReferencesOnBase[3]; + nestedReferences[1].ParentReferenceId = baseReferencesOnBase[3].Id; + + baseReferencesOnBase[3].NestedCollection = new List { nestedCollections[1], nestedCollections[2] }; + nestedCollections[1].ParentReference = baseReferencesOnBase[3]; + nestedCollections[1].ParentReferenceId = baseReferencesOnBase[3].Id; + nestedCollections[2].ParentReference = baseReferencesOnBase[3]; + nestedCollections[2].ParentReferenceId = baseReferencesOnBase[3].Id; + + baseReferencesOnBase[4].NestedReference = nestedReferences[5]; + nestedReferences[5].ParentReference = baseReferencesOnBase[4]; + nestedReferences[5].ParentReferenceId = baseReferencesOnBase[4].Id; + + baseReferencesOnBase[4].NestedCollection = new List { nestedCollections[6] }; + nestedCollections[6].ParentReference = baseReferencesOnBase[4]; + nestedCollections[6].ParentReferenceId = baseReferencesOnBase[4].Id; + + baseReferencesOnBase[6].NestedReference = nestedReferences[6]; + nestedReferences[6].ParentReference = baseReferencesOnBase[6]; + nestedReferences[6].ParentReferenceId = baseReferencesOnBase[6].Id; + + baseReferencesOnBase[6].NestedCollection = new List { nestedCollections[7], nestedCollections[8] }; + nestedCollections[7].ParentReference = baseReferencesOnBase[6]; + nestedCollections[7].ParentReferenceId = baseReferencesOnBase[6].Id; + nestedCollections[8].ParentReference = baseReferencesOnBase[6]; + nestedCollections[8].ParentReferenceId = baseReferencesOnBase[6].Id; + + // BaseCollectionOnBase.NestedReference (inverse: ParentCollection) + // BaseCollectionOnBase.NestedCollection (inverse: ParentCollection) + baseCollectionsOnBase[0].NestedReference = nestedReferences[0]; + nestedReferences[0].ParentCollection = baseCollectionsOnBase[0]; + nestedReferences[0].ParentCollectionId = baseCollectionsOnBase[0].Id; + + baseCollectionsOnBase[0].NestedCollection = new List { nestedCollections[0] }; + nestedCollections[0].ParentCollection = baseCollectionsOnBase[0]; + nestedCollections[0].ParentCollectionId = baseCollectionsOnBase[0].Id; + + baseCollectionsOnBase[1].NestedReference = nestedReferences[4]; + nestedReferences[4].ParentCollection = baseCollectionsOnBase[1]; + nestedReferences[4].ParentCollectionId = baseCollectionsOnBase[1].Id; + + baseCollectionsOnBase[1].NestedCollection = new List { nestedCollections[5] }; + nestedCollections[5].ParentCollection = baseCollectionsOnBase[1]; + nestedCollections[5].ParentCollectionId = baseCollectionsOnBase[1].Id; + + baseCollectionsOnBase[3].NestedReference = nestedReferences[1]; + nestedReferences[1].ParentCollection = baseCollectionsOnBase[3]; + nestedReferences[1].ParentCollectionId = baseCollectionsOnBase[3].Id; + + baseCollectionsOnBase[3].NestedCollection = new List { nestedCollections[1], nestedCollections[2] }; + nestedCollections[1].ParentCollection = baseCollectionsOnBase[3]; + nestedCollections[1].ParentCollectionId = baseCollectionsOnBase[3].Id; + nestedCollections[2].ParentCollection = baseCollectionsOnBase[3]; + nestedCollections[2].ParentCollectionId = baseCollectionsOnBase[3].Id; + + baseCollectionsOnBase[5].NestedReference = nestedReferences[5]; + nestedReferences[5].ParentCollection = baseCollectionsOnBase[5]; + nestedReferences[5].ParentCollectionId = baseCollectionsOnBase[5].Id; + + baseCollectionsOnBase[5].NestedCollection = new List { nestedCollections[6] }; + nestedCollections[6].ParentCollection = baseCollectionsOnBase[5]; + nestedCollections[6].ParentCollectionId = baseCollectionsOnBase[5].Id; + + baseCollectionsOnBase[6].NestedReference = nestedReferences[2]; + nestedReferences[2].ParentCollection = baseCollectionsOnBase[6]; + nestedReferences[2].ParentCollectionId = baseCollectionsOnBase[6].Id; + + baseCollectionsOnBase[6].NestedCollection = new List { nestedCollections[3] }; + nestedCollections[3].ParentCollection = baseCollectionsOnBase[6]; + nestedCollections[3].ParentCollectionId = baseCollectionsOnBase[6].Id; + + baseCollectionsOnBase[8].NestedReference = nestedReferences[6]; + nestedReferences[6].ParentCollection = baseCollectionsOnBase[8]; + nestedReferences[6].ParentCollectionId = baseCollectionsOnBase[8].Id; + + baseCollectionsOnBase[8].NestedCollection = new List { nestedCollections[7], nestedCollections[8] }; + nestedCollections[7].ParentCollection = baseCollectionsOnBase[8]; + nestedCollections[7].ParentCollectionId = baseCollectionsOnBase[8].Id; + nestedCollections[8].ParentCollection = baseCollectionsOnBase[8]; + nestedCollections[8].ParentCollectionId = baseCollectionsOnBase[8].Id; + + baseCollectionsOnBase[11].NestedReference = nestedReferences[7]; + nestedReferences[7].ParentCollection = baseCollectionsOnBase[11]; + nestedReferences[7].ParentCollectionId = baseCollectionsOnBase[11].Id; + + baseCollectionsOnBase[11].NestedCollection = new List { nestedCollections[9], nestedCollections[10] }; + nestedCollections[9].ParentCollection = baseCollectionsOnBase[11]; + nestedCollections[9].ParentCollectionId = baseCollectionsOnBase[11].Id; + nestedCollections[10].ParentCollection = baseCollectionsOnBase[11]; + nestedCollections[10].ParentCollectionId = baseCollectionsOnBase[11].Id; + + // BaseInheritanceRelationshipEntity.BaseReferenceOnBase (inverse: BaseParent) + // BaseInheritanceRelationshipEntity.ReferenceOnBase (inverse: Parent) + baseEntities[0].BaseReferenceOnBase = baseReferencesOnBase[0]; + baseReferencesOnBase[0].BaseParent = baseEntities[0]; + baseReferencesOnBase[0].BaseParentId = baseEntities[0].Id; + + baseEntities[0].ReferenceOnBase = referencesOnBase[0]; + referencesOnBase[0].Parent = baseEntities[0]; + referencesOnBase[0].ParentId = baseEntities[0].Id; + + baseEntities[1].BaseReferenceOnBase = baseReferencesOnBase[4]; + baseReferencesOnBase[4].BaseParent = baseEntities[1]; + baseReferencesOnBase[4].BaseParentId = baseEntities[1].Id; + + baseEntities[1].ReferenceOnBase = referencesOnBase[1]; + referencesOnBase[1].Parent = baseEntities[1]; + referencesOnBase[1].ParentId = baseEntities[1].Id; + + baseEntities[3].BaseReferenceOnBase = baseReferencesOnBase[3]; + baseReferencesOnBase[3].BaseParent = baseEntities[3]; + baseReferencesOnBase[3].BaseParentId = baseEntities[3].Id; + + baseEntities[3].ReferenceOnBase = referencesOnBase[2]; + referencesOnBase[2].Parent = baseEntities[3]; + referencesOnBase[2].ParentId = baseEntities[3].Id; + + // BaseInheritanceRelationshipEntity.BaseCollectionOnBase (inverse: BaseParent) + // BaseInheritanceRelationshipEntity.CollectionOnBase (inverse: Parent) + baseEntities[0].BaseCollectionOnBase = new List { baseCollectionsOnBase[0] }; + baseCollectionsOnBase[0].BaseParent = baseEntities[0]; + baseCollectionsOnBase[0].BaseParentId = baseEntities[0].Id; + + baseEntities[0].CollectionOnBase = new List { collectionsOnBase[0], collectionsOnBase[1] }; + collectionsOnBase[0].Parent = baseEntities[0]; + collectionsOnBase[0].ParentId = baseEntities[0].Id; + collectionsOnBase[1].Parent = baseEntities[0]; + collectionsOnBase[1].ParentId = baseEntities[0].Id; + + baseEntities[1].CollectionOnBase = new List { collectionsOnBase[2] }; + collectionsOnBase[2].Parent = baseEntities[1]; + collectionsOnBase[2].ParentId = baseEntities[1].Id; + + baseEntities[2].BaseCollectionOnBase = new List { baseCollectionsOnBase[7] }; + baseCollectionsOnBase[7].BaseParent = baseEntities[2]; + baseCollectionsOnBase[7].BaseParentId = baseEntities[2].Id; + + baseEntities[3].BaseCollectionOnBase = new List { baseCollectionsOnBase[5], baseCollectionsOnBase[6] }; + baseCollectionsOnBase[5].BaseParent = baseEntities[3]; + baseCollectionsOnBase[5].BaseParentId = baseEntities[3].Id; + baseCollectionsOnBase[6].BaseParent = baseEntities[3]; + baseCollectionsOnBase[6].BaseParentId = baseEntities[3].Id; + + baseEntities[3].CollectionOnBase = new List { collectionsOnBase[3], collectionsOnBase[4] }; + collectionsOnBase[3].Parent = baseEntities[3]; + collectionsOnBase[3].ParentId = baseEntities[3].Id; + collectionsOnBase[4].Parent = baseEntities[3]; + collectionsOnBase[4].ParentId = baseEntities[3].Id; + + // DerivedInheritanceRelationshipEntity navigations + baseEntities[0].DerivedSefReferenceOnBase = (DerivedInheritanceRelationshipEntity)baseEntities[3]; + ((DerivedInheritanceRelationshipEntity)baseEntities[3]).BaseSelfReferenceOnDerived = baseEntities[0]; + ((DerivedInheritanceRelationshipEntity)baseEntities[3]).BaseId = baseEntities[0].Id; + + ((DerivedInheritanceRelationshipEntity)baseEntities[3]).BaseReferenceOnDerived = baseReferencesOnDerived[0]; + baseReferencesOnDerived[0].BaseParent = (DerivedInheritanceRelationshipEntity)baseEntities[3]; + baseReferencesOnDerived[0].BaseParentId = baseEntities[3].Id; + + ((DerivedInheritanceRelationshipEntity)baseEntities[3]).DerivedReferenceOnDerived = (DerivedReferenceOnDerived)baseReferencesOnDerived[3]; + + ((DerivedInheritanceRelationshipEntity)baseEntities[3]).ReferenceOnDerived = referencesOnDerived[0]; + referencesOnDerived[0].Parent = (DerivedInheritanceRelationshipEntity)baseEntities[3]; + referencesOnDerived[0].ParentId = baseEntities[3].Id; + + ((DerivedInheritanceRelationshipEntity)baseEntities[3]).BaseCollectionOnDerived = new List { baseCollectionsOnDerived[0] }; + baseCollectionsOnDerived[0].BaseParent = (DerivedInheritanceRelationshipEntity)baseEntities[3]; + baseCollectionsOnDerived[0].ParentId = baseEntities[3].Id; + + ((DerivedInheritanceRelationshipEntity)baseEntities[3]).CollectionOnDerived = new List { collectionsOnDerived[0] }; + collectionsOnDerived[0].Parent = (DerivedInheritanceRelationshipEntity)baseEntities[3]; + collectionsOnDerived[0].ParentId = baseEntities[3].Id; + + ((DerivedInheritanceRelationshipEntity)baseEntities[3]).DerivedCollectionOnDerived = new List + { + (DerivedCollectionOnDerived)baseCollectionsOnDerived[3], + (DerivedCollectionOnDerived)baseCollectionsOnDerived[4] + }; + } + } +} diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/NestedCollectionBase.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/NestedCollectionBase.cs similarity index 97% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/NestedCollectionBase.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/NestedCollectionBase.cs index 67a5b15783f..1ac572a82d9 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/NestedCollectionBase.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/NestedCollectionBase.cs @@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema; -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class NestedCollectionBase { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/NestedCollectionDerived.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/NestedCollectionDerived.cs similarity index 94% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/NestedCollectionDerived.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/NestedCollectionDerived.cs index 809dc7e2b0a..a2a5c165ac7 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/NestedCollectionDerived.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/NestedCollectionDerived.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class NestedCollectionDerived : NestedCollectionBase { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/NestedReferenceBase.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/NestedReferenceBase.cs similarity index 97% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/NestedReferenceBase.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/NestedReferenceBase.cs index da1a934386a..f0984db0691 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/NestedReferenceBase.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/NestedReferenceBase.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class NestedReferenceBase { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/NestedReferenceDerived.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/NestedReferenceDerived.cs similarity index 94% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/NestedReferenceDerived.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/NestedReferenceDerived.cs index 43009d5c81a..f1501fdd809 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/NestedReferenceDerived.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/NestedReferenceDerived.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class NestedReferenceDerived : NestedReferenceBase { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/NonEntityBase.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/NonEntityBase.cs similarity index 96% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/NonEntityBase.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/NonEntityBase.cs index e0f064ff365..70e29e0df0b 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/NonEntityBase.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/NonEntityBase.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class NonEntityBase { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/OwnedEntity.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/OwnedEntity.cs similarity index 95% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/OwnedEntity.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/OwnedEntity.cs index 401cb467bd2..7d79bbda43f 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/OwnedEntity.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/OwnedEntity.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class OwnedEntity { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/PrincipalEntity.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/PrincipalEntity.cs similarity index 94% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/PrincipalEntity.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/PrincipalEntity.cs index f1361f6967c..113f1223659 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/PrincipalEntity.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/PrincipalEntity.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class PrincipalEntity : NonEntityBase { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/ReferenceOnBase.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/ReferenceOnBase.cs similarity index 96% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/ReferenceOnBase.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/ReferenceOnBase.cs index 7185dfbf68a..8772ab45c63 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/ReferenceOnBase.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/ReferenceOnBase.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class ReferenceOnBase { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/ReferenceOnDerived.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/ReferenceOnDerived.cs similarity index 96% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/ReferenceOnDerived.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/ReferenceOnDerived.cs index 118e5e0d73b..c4b305be023 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/ReferenceOnDerived.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/ReferenceOnDerived.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class ReferenceOnDerived { diff --git a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/ReferencedEntity.cs b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/ReferencedEntity.cs similarity index 96% rename from test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/ReferencedEntity.cs rename to test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/ReferencedEntity.cs index 5a3c05d22b1..ebc14fe1c40 100644 --- a/test/EFCore.Specification.Tests/TestModels/InheritanceRelationships/ReferencedEntity.cs +++ b/test/EFCore.Specification.Tests/TestModels/InheritanceRelationshipsModel/ReferencedEntity.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationships +namespace Microsoft.EntityFrameworkCore.TestModels.InheritanceRelationshipsModel { public class ReferencedEntity { diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/InheritanceRelationshipsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/InheritanceRelationshipsQuerySqlServerTest.cs index 6171798bb36..e6605773804 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/InheritanceRelationshipsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/InheritanceRelationshipsQuerySqlServerTest.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.TestUtilities; using Xunit.Abstractions; @@ -16,9 +17,9 @@ public InheritanceRelationshipsQuerySqlServerTest( fixture.TestSqlLoggerFactory.Clear(); } - public override void Include_reference_with_inheritance() + public override async Task Include_reference_with_inheritance(bool async) { - base.Include_reference_with_inheritance(); + await base.Include_reference_with_inheritance(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[Id], [b0].[BaseParentId], [b0].[Discriminator], [b0].[Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -30,9 +31,9 @@ FROM [BaseEntities] AS [b] } - public override void Include_reference_with_inheritance_reverse() + public override async Task Include_reference_with_inheritance_reverse(bool async) { - base.Include_reference_with_inheritance_reverse(); + await base.Include_reference_with_inheritance_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -43,9 +44,9 @@ FROM [BaseReferencesOnBase] AS [b] ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Include_self_reference_with_inheritance() + public override async Task Include_self_reference_with_inheritance(bool async) { - base.Include_self_reference_with_inheritance(); + await base.Include_self_reference_with_inheritance(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [t].[Id], [t].[Discriminator], [t].[Name], [t].[BaseId], [t].[Id0], [t].[OwnedReferenceOnBase_Id], [t].[OwnedReferenceOnBase_Name], [t].[OwnedReferenceOnDerived_Id], [t].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name] @@ -62,9 +63,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id]"); } - public override void Include_self_reference_with_inheritance_reverse() + public override async Task Include_self_reference_with_inheritance_reverse(bool async) { - base.Include_self_reference_with_inheritance_reverse(); + await base.Include_self_reference_with_inheritance_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name] @@ -78,9 +79,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id]"); } - public override void Include_reference_with_inheritance_with_filter() + public override async Task Include_reference_with_inheritance_with_filter(bool async) { - base.Include_reference_with_inheritance_with_filter(); + await base.Include_reference_with_inheritance_with_filter(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[Id], [b0].[BaseParentId], [b0].[Discriminator], [b0].[Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -92,9 +93,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Include_reference_with_inheritance_with_filter_reverse() + public override async Task Include_reference_with_inheritance_with_filter_reverse(bool async) { - base.Include_reference_with_inheritance_with_filter_reverse(); + await base.Include_reference_with_inheritance_with_filter_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -107,9 +108,9 @@ FROM [BaseReferencesOnBase] AS [b] } - public override void Include_reference_without_inheritance() + public override async Task Include_reference_without_inheritance(bool async) { - base.Include_reference_without_inheritance(); + await base.Include_reference_without_inheritance(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [r].[Id], [r].[Name], [r].[ParentId], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name] @@ -121,9 +122,9 @@ FROM [BaseEntities] AS [b] } - public override void Include_reference_without_inheritance_reverse() + public override async Task Include_reference_without_inheritance_reverse(bool async) { - base.Include_reference_without_inheritance_reverse(); + await base.Include_reference_without_inheritance_reverse(async); AssertSql( @"SELECT [r].[Id], [r].[Name], [r].[ParentId], [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name] @@ -135,9 +136,9 @@ FROM [ReferencesOnBase] AS [r] } - public override void Include_reference_without_inheritance_with_filter() + public override async Task Include_reference_without_inheritance_with_filter(bool async) { - base.Include_reference_without_inheritance_with_filter(); + await base.Include_reference_without_inheritance_with_filter(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [r].[Id], [r].[Name], [r].[ParentId], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name] @@ -149,9 +150,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [r].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id]"); } - public override void Include_reference_without_inheritance_with_filter_reverse() + public override async Task Include_reference_without_inheritance_with_filter_reverse(bool async) { - base.Include_reference_without_inheritance_with_filter_reverse(); + await base.Include_reference_without_inheritance_with_filter_reverse(async); AssertSql( @"SELECT [r].[Id], [r].[Name], [r].[ParentId], [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name] @@ -163,9 +164,9 @@ FROM [ReferencesOnBase] AS [r] ORDER BY [r].[Id], [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id]"); } - public override void Include_collection_with_inheritance() + public override async Task Include_collection_with_inheritance(bool async) { - base.Include_collection_with_inheritance(); + await base.Include_collection_with_inheritance(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[Id], [b2].[BaseParentId], [b2].[Discriminator], [b2].[Name], [b2].[DerivedProperty] @@ -176,9 +177,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b2].[Id]"); } - public override void Include_collection_with_inheritance_reverse() + public override async Task Include_collection_with_inheritance_reverse(bool async) { - base.Include_collection_with_inheritance_reverse(); + await base.Include_collection_with_inheritance_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b].[DerivedProperty], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -189,9 +190,9 @@ FROM [BaseCollectionsOnBase] AS [b] ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Include_collection_with_inheritance_with_filter() + public override async Task Include_collection_with_inheritance_with_filter(bool async) { - base.Include_collection_with_inheritance_with_filter(); + await base.Include_collection_with_inheritance_with_filter(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[Id], [b2].[BaseParentId], [b2].[Discriminator], [b2].[Name], [b2].[DerivedProperty] @@ -203,9 +204,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b2].[Id]"); } - public override void Include_collection_with_inheritance_with_filter_reverse() + public override async Task Include_collection_with_inheritance_with_filter_reverse(bool async) { - base.Include_collection_with_inheritance_with_filter_reverse(); + await base.Include_collection_with_inheritance_with_filter_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b].[DerivedProperty], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -217,9 +218,9 @@ FROM [BaseCollectionsOnBase] AS [b] ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Include_collection_without_inheritance() + public override async Task Include_collection_without_inheritance(bool async) { - base.Include_collection_without_inheritance(); + await base.Include_collection_without_inheritance(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [c].[Id], [c].[Name], [c].[ParentId] @@ -230,9 +231,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [c].[Id]"); } - public override void Include_collection_without_inheritance_reverse() + public override async Task Include_collection_without_inheritance_reverse(bool async) { - base.Include_collection_without_inheritance_reverse(); + await base.Include_collection_without_inheritance_reverse(async); AssertSql( @"SELECT [c].[Id], [c].[Name], [c].[ParentId], [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name] @@ -243,9 +244,9 @@ FROM [CollectionsOnBase] AS [c] ORDER BY [c].[Id], [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id]"); } - public override void Include_collection_without_inheritance_with_filter() + public override async Task Include_collection_without_inheritance_with_filter(bool async) { - base.Include_collection_without_inheritance_with_filter(); + await base.Include_collection_without_inheritance_with_filter(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [c].[Id], [c].[Name], [c].[ParentId] @@ -257,9 +258,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [c].[Id]"); } - public override void Include_collection_without_inheritance_with_filter_reverse() + public override async Task Include_collection_without_inheritance_with_filter_reverse(bool async) { - base.Include_collection_without_inheritance_with_filter_reverse(); + await base.Include_collection_without_inheritance_with_filter_reverse(async); AssertSql( @"SELECT [c].[Id], [c].[Name], [c].[ParentId], [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name] @@ -271,9 +272,9 @@ FROM [CollectionsOnBase] AS [c] ORDER BY [c].[Id], [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id]"); } - public override void Include_reference_with_inheritance_on_derived1() + public override async Task Include_reference_with_inheritance_on_derived1(bool async) { - base.Include_reference_with_inheritance_on_derived1(); + await base.Include_reference_with_inheritance_on_derived1(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[Id], [b0].[BaseParentId], [b0].[Discriminator], [b0].[Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -285,9 +286,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Include_reference_with_inheritance_on_derived2() + public override async Task Include_reference_with_inheritance_on_derived2(bool async) { - base.Include_reference_with_inheritance_on_derived2(); + await base.Include_reference_with_inheritance_on_derived2(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[Id], [b0].[BaseParentId], [b0].[Discriminator], [b0].[Name], [b0].[DerivedInheritanceRelationshipEntityId], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -299,9 +300,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Include_reference_with_inheritance_on_derived4() + public override async Task Include_reference_with_inheritance_on_derived4(bool async) { - base.Include_reference_with_inheritance_on_derived4(); + await base.Include_reference_with_inheritance_on_derived4(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [t].[Id], [t].[BaseParentId], [t].[Discriminator], [t].[Name], [t].[DerivedInheritanceRelationshipEntityId], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -317,9 +318,9 @@ FROM [BaseReferencesOnDerived] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Include_reference_with_inheritance_on_derived_reverse() + public override async Task Include_reference_with_inheritance_on_derived_reverse(bool async) { - base.Include_reference_with_inheritance_on_derived_reverse(); + await base.Include_reference_with_inheritance_on_derived_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b].[DerivedInheritanceRelationshipEntityId], [t].[Id], [t].[Discriminator], [t].[Name], [t].[BaseId], [t].[Id0], [t].[OwnedReferenceOnBase_Id], [t].[OwnedReferenceOnBase_Name], [t].[OwnedReferenceOnDerived_Id], [t].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -335,9 +336,9 @@ FROM [BaseEntities] AS [b0] } - public override void Include_reference_with_inheritance_on_derived_with_filter1() + public override async Task Include_reference_with_inheritance_on_derived_with_filter1(bool async) { - base.Include_reference_with_inheritance_on_derived_with_filter1(); + await base.Include_reference_with_inheritance_on_derived_with_filter1(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[Id], [b0].[BaseParentId], [b0].[Discriminator], [b0].[Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -349,9 +350,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Include_reference_with_inheritance_on_derived_with_filter2() + public override async Task Include_reference_with_inheritance_on_derived_with_filter2(bool async) { - base.Include_reference_with_inheritance_on_derived_with_filter2(); + await base.Include_reference_with_inheritance_on_derived_with_filter2(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[Id], [b0].[BaseParentId], [b0].[Discriminator], [b0].[Name], [b0].[DerivedInheritanceRelationshipEntityId], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -363,9 +364,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Include_reference_with_inheritance_on_derived_with_filter4() + public override async Task Include_reference_with_inheritance_on_derived_with_filter4(bool async) { - base.Include_reference_with_inheritance_on_derived_with_filter4(); + await base.Include_reference_with_inheritance_on_derived_with_filter4(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [t].[Id], [t].[BaseParentId], [t].[Discriminator], [t].[Name], [t].[DerivedInheritanceRelationshipEntityId], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -381,9 +382,9 @@ FROM [BaseReferencesOnDerived] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Include_reference_with_inheritance_on_derived_with_filter_reverse() + public override async Task Include_reference_with_inheritance_on_derived_with_filter_reverse(bool async) { - base.Include_reference_with_inheritance_on_derived_with_filter_reverse(); + await base.Include_reference_with_inheritance_on_derived_with_filter_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b].[DerivedInheritanceRelationshipEntityId], [t].[Id], [t].[Discriminator], [t].[Name], [t].[BaseId], [t].[Id0], [t].[OwnedReferenceOnBase_Id], [t].[OwnedReferenceOnBase_Name], [t].[OwnedReferenceOnDerived_Id], [t].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -399,9 +400,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Include_reference_without_inheritance_on_derived1() + public override async Task Include_reference_without_inheritance_on_derived1(bool async) { - base.Include_reference_without_inheritance_on_derived1(); + await base.Include_reference_without_inheritance_on_derived1(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [r].[Id], [r].[Name], [r].[ParentId], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name] @@ -413,9 +414,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [r].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id]"); } - public override void Include_reference_without_inheritance_on_derived2() + public override async Task Include_reference_without_inheritance_on_derived2(bool async) { - base.Include_reference_without_inheritance_on_derived2(); + await base.Include_reference_without_inheritance_on_derived2(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [r].[Id], [r].[Name], [r].[ParentId], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name] @@ -427,9 +428,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [r].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id]"); } - public override void Include_reference_without_inheritance_on_derived_reverse() + public override async Task Include_reference_without_inheritance_on_derived_reverse(bool async) { - base.Include_reference_without_inheritance_on_derived_reverse(); + await base.Include_reference_without_inheritance_on_derived_reverse(async); AssertSql( @"SELECT [r].[Id], [r].[Name], [r].[ParentId], [t].[Id], [t].[Discriminator], [t].[Name], [t].[BaseId], [t].[Id0], [t].[OwnedReferenceOnBase_Id], [t].[OwnedReferenceOnBase_Name], [t].[OwnedReferenceOnDerived_Id], [t].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name] @@ -444,9 +445,9 @@ FROM [BaseEntities] AS [b] ORDER BY [r].[Id], [t].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id]"); } - public override void Include_collection_with_inheritance_on_derived1() + public override async Task Include_collection_with_inheritance_on_derived1(bool async) { - base.Include_collection_with_inheritance_on_derived1(); + await base.Include_collection_with_inheritance_on_derived1(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[Id], [b2].[BaseParentId], [b2].[Discriminator], [b2].[Name], [b2].[DerivedProperty] @@ -458,9 +459,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b2].[Id]"); } - public override void Include_collection_with_inheritance_on_derived2() + public override async Task Include_collection_with_inheritance_on_derived2(bool async) { - base.Include_collection_with_inheritance_on_derived2(); + await base.Include_collection_with_inheritance_on_derived2(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[Id], [b2].[Discriminator], [b2].[Name], [b2].[ParentId], [b2].[DerivedInheritanceRelationshipEntityId] @@ -472,9 +473,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b2].[Id]"); } - public override void Include_collection_with_inheritance_on_derived3() + public override async Task Include_collection_with_inheritance_on_derived3(bool async) { - base.Include_collection_with_inheritance_on_derived3(); + await base.Include_collection_with_inheritance_on_derived3(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [t].[Id], [t].[Discriminator], [t].[Name], [t].[ParentId], [t].[DerivedInheritanceRelationshipEntityId] @@ -491,9 +492,9 @@ FROM [BaseCollectionsOnDerived] AS [b2] } - public override void Include_collection_with_inheritance_on_derived_reverse() + public override async Task Include_collection_with_inheritance_on_derived_reverse(bool async) { - base.Include_collection_with_inheritance_on_derived_reverse(); + await base.Include_collection_with_inheritance_on_derived_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[ParentId], [b].[DerivedInheritanceRelationshipEntityId], [t].[Id], [t].[Discriminator], [t].[Name], [t].[BaseId], [t].[Id0], [t].[OwnedReferenceOnBase_Id], [t].[OwnedReferenceOnBase_Name], [t].[OwnedReferenceOnDerived_Id], [t].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -508,9 +509,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Nested_include_with_inheritance_reference_reference() + public override async Task Nested_include_with_inheritance_reference_reference(bool async) { - base.Nested_include_with_inheritance_reference_reference(); + await base.Nested_include_with_inheritance_reference_reference(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[Id], [b0].[BaseParentId], [b0].[Discriminator], [b0].[Name], [n].[Id], [n].[Discriminator], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -522,9 +523,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[Id], [n].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Nested_include_with_inheritance_reference_reference_on_base() + public override async Task Nested_include_with_inheritance_reference_reference_on_base(bool async) { - base.Nested_include_with_inheritance_reference_reference_on_base(); + await base.Nested_include_with_inheritance_reference_reference_on_base(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[Id], [b0].[BaseParentId], [b0].[Discriminator], [b0].[Name], [n].[Id], [n].[Discriminator], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -537,9 +538,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[Id], [n].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Nested_include_with_inheritance_reference_reference_reverse() + public override async Task Nested_include_with_inheritance_reference_reference_reverse(bool async) { - base.Nested_include_with_inheritance_reference_reference_reverse(); + await base.Nested_include_with_inheritance_reference_reference_reverse(async); AssertSql( @"SELECT [n].[Id], [n].[Discriminator], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -551,9 +552,9 @@ FROM [NestedReferences] AS [n] ORDER BY [n].[Id], [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Nested_include_with_inheritance_reference_collection() + public override async Task Nested_include_with_inheritance_reference_collection(bool async) { - base.Nested_include_with_inheritance_reference_collection(); + await base.Nested_include_with_inheritance_reference_collection(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[Id], [b0].[BaseParentId], [b0].[Discriminator], [b0].[Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [n].[Id], [n].[Discriminator], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId] @@ -565,9 +566,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [n].[Id]"); } - public override void Nested_include_with_inheritance_reference_collection_on_base() + public override async Task Nested_include_with_inheritance_reference_collection_on_base(bool async) { - base.Nested_include_with_inheritance_reference_collection_on_base(); + await base.Nested_include_with_inheritance_reference_collection_on_base(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[Id], [b0].[BaseParentId], [b0].[Discriminator], [b0].[Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [n].[Id], [n].[Discriminator], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId] @@ -580,9 +581,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [n].[Id]"); } - public override void Nested_include_with_inheritance_reference_collection_reverse() + public override async Task Nested_include_with_inheritance_reference_collection_reverse(bool async) { - base.Nested_include_with_inheritance_reference_collection_reverse(); + await base.Nested_include_with_inheritance_reference_collection_reverse(async); AssertSql( @"SELECT [n].[Id], [n].[Discriminator], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -594,9 +595,9 @@ FROM [NestedCollections] AS [n] ORDER BY [n].[Id], [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Nested_include_with_inheritance_collection_reference() + public override async Task Nested_include_with_inheritance_collection_reference(bool async) { - base.Nested_include_with_inheritance_collection_reference(); + await base.Nested_include_with_inheritance_collection_reference(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [t].[Id], [t].[BaseParentId], [t].[Discriminator], [t].[Name], [t].[DerivedProperty], [t].[Id0], [t].[Discriminator0], [t].[Name0], [t].[ParentCollectionId], [t].[ParentReferenceId] @@ -611,9 +612,9 @@ FROM [BaseCollectionsOnBase] AS [b2] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [t].[Id], [t].[Id0]"); } - public override void Nested_include_with_inheritance_collection_reference_reverse() + public override async Task Nested_include_with_inheritance_collection_reference_reverse(bool async) { - base.Nested_include_with_inheritance_collection_reference_reverse(); + await base.Nested_include_with_inheritance_collection_reference_reverse(async); AssertSql( @"SELECT [n].[Id], [n].[Discriminator], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b].[DerivedProperty], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -625,9 +626,9 @@ FROM [NestedReferences] AS [n] ORDER BY [n].[Id], [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Nested_include_with_inheritance_collection_collection() + public override async Task Nested_include_with_inheritance_collection_collection(bool async) { - base.Nested_include_with_inheritance_collection_collection(); + await base.Nested_include_with_inheritance_collection_collection(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [t].[Id], [t].[BaseParentId], [t].[Discriminator], [t].[Name], [t].[DerivedProperty], [t].[Id0], [t].[Discriminator0], [t].[Name0], [t].[ParentCollectionId], [t].[ParentReferenceId] @@ -642,9 +643,9 @@ FROM [BaseCollectionsOnBase] AS [b2] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [t].[Id], [t].[Id0]"); } - public override void Nested_include_with_inheritance_collection_collection_reverse() + public override async Task Nested_include_with_inheritance_collection_collection_reverse(bool async) { - base.Nested_include_with_inheritance_collection_collection_reverse(); + await base.Nested_include_with_inheritance_collection_collection_reverse(async); AssertSql( @"SELECT [n].[Id], [n].[Discriminator], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b].[DerivedProperty], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -656,9 +657,9 @@ FROM [NestedCollections] AS [n] ORDER BY [n].[Id], [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Nested_include_collection_reference_on_non_entity_base() + public override async Task Nested_include_collection_reference_on_non_entity_base(bool async) { - base.Nested_include_collection_reference_on_non_entity_base(); + await base.Nested_include_collection_reference_on_non_entity_base(async); AssertSql( @"SELECT [r].[Id], [r].[Name], [t].[Id], [t].[Name], [t].[ReferenceId], [t].[ReferencedEntityId], [t].[Id0], [t].[Name0] @@ -671,9 +672,9 @@ FROM [PrincipalEntities] AS [p] ORDER BY [r].[Id], [t].[Id], [t].[Id0]"); } - public override void Include_collection_with_inheritance_split() + public override async Task Include_collection_with_inheritance_split(bool async) { - base.Include_collection_with_inheritance_split(); + await base.Include_collection_with_inheritance_split(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[Id], [b2].[BaseParentId], [b2].[Discriminator], [b2].[Name], [b2].[DerivedProperty] @@ -684,9 +685,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b2].[Id]"); } - public override void Include_collection_with_inheritance_reverse_split() + public override async Task Include_collection_with_inheritance_reverse_split(bool async) { - base.Include_collection_with_inheritance_reverse_split(); + await base.Include_collection_with_inheritance_reverse_split(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b].[DerivedProperty], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -697,9 +698,9 @@ FROM [BaseCollectionsOnBase] AS [b] ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Include_collection_with_inheritance_with_filter_split() + public override async Task Include_collection_with_inheritance_with_filter_split(bool async) { - base.Include_collection_with_inheritance_with_filter_split(); + await base.Include_collection_with_inheritance_with_filter_split(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[Id], [b2].[BaseParentId], [b2].[Discriminator], [b2].[Name], [b2].[DerivedProperty] @@ -711,9 +712,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b2].[Id]"); } - public override void Include_collection_with_inheritance_with_filter_reverse_split() + public override async Task Include_collection_with_inheritance_with_filter_reverse_split(bool async) { - base.Include_collection_with_inheritance_with_filter_reverse_split(); + await base.Include_collection_with_inheritance_with_filter_reverse_split(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b].[DerivedProperty], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -725,9 +726,9 @@ FROM [BaseCollectionsOnBase] AS [b] ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Include_collection_without_inheritance_split() + public override async Task Include_collection_without_inheritance_split(bool async) { - base.Include_collection_without_inheritance_split(); + await base.Include_collection_without_inheritance_split(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [c].[Id], [c].[Name], [c].[ParentId] @@ -738,9 +739,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [c].[Id]"); } - public override void Include_collection_without_inheritance_reverse_split() + public override async Task Include_collection_without_inheritance_reverse_split(bool async) { - base.Include_collection_without_inheritance_reverse_split(); + await base.Include_collection_without_inheritance_reverse_split(async); AssertSql( @"SELECT [c].[Id], [c].[Name], [c].[ParentId], [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name] @@ -751,9 +752,9 @@ FROM [CollectionsOnBase] AS [c] ORDER BY [c].[Id], [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id]"); } - public override void Include_collection_without_inheritance_with_filter_split() + public override async Task Include_collection_without_inheritance_with_filter_split(bool async) { - base.Include_collection_without_inheritance_with_filter_split(); + await base.Include_collection_without_inheritance_with_filter_split(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [c].[Id], [c].[Name], [c].[ParentId] @@ -765,9 +766,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [c].[Id]"); } - public override void Include_collection_without_inheritance_with_filter_reverse_split() + public override async Task Include_collection_without_inheritance_with_filter_reverse_split(bool async) { - base.Include_collection_without_inheritance_with_filter_reverse_split(); + await base.Include_collection_without_inheritance_with_filter_reverse_split(async); AssertSql( @"SELECT [c].[Id], [c].[Name], [c].[ParentId], [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name] @@ -779,9 +780,9 @@ FROM [CollectionsOnBase] AS [c] ORDER BY [c].[Id], [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id]"); } - public override void Include_collection_with_inheritance_on_derived1_split() + public override async Task Include_collection_with_inheritance_on_derived1_split(bool async) { - base.Include_collection_with_inheritance_on_derived1_split(); + await base.Include_collection_with_inheritance_on_derived1_split(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[Id], [b2].[BaseParentId], [b2].[Discriminator], [b2].[Name], [b2].[DerivedProperty] @@ -793,9 +794,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b2].[Id]"); } - public override void Include_collection_with_inheritance_on_derived2_split() + public override async Task Include_collection_with_inheritance_on_derived2_split(bool async) { - base.Include_collection_with_inheritance_on_derived2_split(); + await base.Include_collection_with_inheritance_on_derived2_split(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[Id], [b2].[Discriminator], [b2].[Name], [b2].[ParentId], [b2].[DerivedInheritanceRelationshipEntityId] @@ -807,9 +808,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b2].[Id]"); } - public override void Include_collection_with_inheritance_on_derived3_split() + public override async Task Include_collection_with_inheritance_on_derived3_split(bool async) { - base.Include_collection_with_inheritance_on_derived3_split(); + await base.Include_collection_with_inheritance_on_derived3_split(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [t].[Id], [t].[Discriminator], [t].[Name], [t].[ParentId], [t].[DerivedInheritanceRelationshipEntityId] @@ -825,9 +826,9 @@ FROM [BaseCollectionsOnDerived] AS [b2] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [t].[Id]"); } - public override void Include_collection_with_inheritance_on_derived_reverse_split() + public override async Task Include_collection_with_inheritance_on_derived_reverse_split(bool async) { - base.Include_collection_with_inheritance_on_derived_reverse_split(); + await base.Include_collection_with_inheritance_on_derived_reverse_split(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[ParentId], [b].[DerivedInheritanceRelationshipEntityId], [t].[Id], [t].[Discriminator], [t].[Name], [t].[BaseId], [t].[Id0], [t].[OwnedReferenceOnBase_Id], [t].[OwnedReferenceOnBase_Name], [t].[OwnedReferenceOnDerived_Id], [t].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -842,9 +843,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Nested_include_with_inheritance_reference_collection_split() + public override async Task Nested_include_with_inheritance_reference_collection_split(bool async) { - base.Nested_include_with_inheritance_reference_collection_split(); + await base.Nested_include_with_inheritance_reference_collection_split(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[Id], [b0].[BaseParentId], [b0].[Discriminator], [b0].[Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [n].[Id], [n].[Discriminator], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId] @@ -856,9 +857,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [n].[Id]"); } - public override void Nested_include_with_inheritance_reference_collection_on_base_split() + public override async Task Nested_include_with_inheritance_reference_collection_on_base_split(bool async) { - base.Nested_include_with_inheritance_reference_collection_on_base_split(); + await base.Nested_include_with_inheritance_reference_collection_on_base_split(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[Id], [b0].[BaseParentId], [b0].[Discriminator], [b0].[Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [n].[Id], [n].[Discriminator], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId] @@ -871,9 +872,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [n].[Id]"); } - public override void Nested_include_with_inheritance_reference_collection_reverse_split() + public override async Task Nested_include_with_inheritance_reference_collection_reverse_split(bool async) { - base.Nested_include_with_inheritance_reference_collection_reverse_split(); + await base.Nested_include_with_inheritance_reference_collection_reverse_split(async); AssertSql( @"SELECT [n].[Id], [n].[Discriminator], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -885,9 +886,9 @@ FROM [NestedCollections] AS [n] ORDER BY [n].[Id], [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Nested_include_with_inheritance_collection_reference_split() + public override async Task Nested_include_with_inheritance_collection_reference_split(bool async) { - base.Nested_include_with_inheritance_collection_reference_split(); + await base.Nested_include_with_inheritance_collection_reference_split(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [t].[Id], [t].[BaseParentId], [t].[Discriminator], [t].[Name], [t].[DerivedProperty], [t].[Id0], [t].[Discriminator0], [t].[Name0], [t].[ParentCollectionId], [t].[ParentReferenceId] @@ -902,9 +903,9 @@ FROM [BaseCollectionsOnBase] AS [b2] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [t].[Id], [t].[Id0]"); } - public override void Nested_include_with_inheritance_collection_reference_reverse_split() + public override async Task Nested_include_with_inheritance_collection_reference_reverse_split(bool async) { - base.Nested_include_with_inheritance_collection_reference_reverse_split(); + await base.Nested_include_with_inheritance_collection_reference_reverse_split(async); AssertSql( @"SELECT [n].[Id], [n].[Discriminator], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b].[DerivedProperty], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -916,9 +917,9 @@ FROM [NestedReferences] AS [n] ORDER BY [n].[Id], [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Nested_include_with_inheritance_collection_collection_split() + public override async Task Nested_include_with_inheritance_collection_collection_split(bool async) { - base.Nested_include_with_inheritance_collection_collection_split(); + await base.Nested_include_with_inheritance_collection_collection_split(async); AssertSql( @"SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [t].[Id], [t].[BaseParentId], [t].[Discriminator], [t].[Name], [t].[DerivedProperty], [t].[Id0], [t].[Discriminator0], [t].[Name0], [t].[ParentCollectionId], [t].[ParentReferenceId] @@ -933,9 +934,9 @@ FROM [BaseCollectionsOnBase] AS [b2] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId], [b1].[Id], [t].[Id], [t].[Id0]"); } - public override void Nested_include_with_inheritance_collection_collection_reverse_split() + public override async Task Nested_include_with_inheritance_collection_collection_reverse_split(bool async) { - base.Nested_include_with_inheritance_collection_collection_reverse_split(); + await base.Nested_include_with_inheritance_collection_collection_reverse_split(async); AssertSql( @"SELECT [n].[Id], [n].[Discriminator], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b].[DerivedProperty], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name] @@ -947,9 +948,9 @@ FROM [NestedCollections] AS [n] ORDER BY [n].[Id], [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id]"); } - public override void Nested_include_collection_reference_on_non_entity_base_split() + public override async Task Nested_include_collection_reference_on_non_entity_base_split(bool async) { - base.Nested_include_collection_reference_on_non_entity_base_split(); + await base.Nested_include_collection_reference_on_non_entity_base_split(async); AssertSql( @"SELECT [r].[Id], [r].[Name], [t].[Id], [t].[Name], [t].[ReferenceId], [t].[ReferencedEntityId], [t].[Id0], [t].[Name0] diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TPTRelationshipsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TPTRelationshipsQuerySqlServerTest.cs index dd8930b42a3..ffa71e9c35e 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/TPTRelationshipsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/TPTRelationshipsQuerySqlServerTest.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.TestUtilities; using Xunit.Abstractions; @@ -44,9 +45,9 @@ FROM [BaseCollectionsOnBase] AS [b1] ORDER BY [t].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [t0].[Id]"); } - public override void Include_collection_without_inheritance() + public override async Task Include_collection_without_inheritance(bool async) { - base.Include_collection_without_inheritance(); + await base.Include_collection_without_inheritance(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -61,9 +62,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [c].[Id]"); } - public override void Include_collection_without_inheritance_reverse() + public override async Task Include_collection_without_inheritance_reverse(bool async) { - base.Include_collection_without_inheritance_reverse(); + await base.Include_collection_without_inheritance_reverse(async); AssertSql( @"SELECT [c].[Id], [c].[Name], [c].[ParentId], [t].[Id], [t].[Name], [t].[BaseId], [t].[IsDerivedInheritanceRelationshipEntity], [t].[Id0], [t].[OwnedReferenceOnBase_Id], [t].[OwnedReferenceOnBase_Name], [t].[Id1], [t].[OwnedReferenceOnDerived_Id], [t].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [d0].[Name] @@ -81,9 +82,9 @@ FROM [BaseEntities] AS [b] ORDER BY [c].[Id], [t].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id]"); } - public override void Include_collection_without_inheritance_with_filter() + public override async Task Include_collection_without_inheritance_with_filter(bool async) { - base.Include_collection_without_inheritance_with_filter(); + await base.Include_collection_without_inheritance_with_filter(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -99,9 +100,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [c].[Id]"); } - public override void Include_collection_without_inheritance_with_filter_reverse() + public override async Task Include_collection_without_inheritance_with_filter_reverse(bool async) { - base.Include_collection_without_inheritance_with_filter_reverse(); + await base.Include_collection_without_inheritance_with_filter_reverse(async); AssertSql( @"SELECT [c].[Id], [c].[Name], [c].[ParentId], [t].[Id], [t].[Name], [t].[BaseId], [t].[IsDerivedInheritanceRelationshipEntity], [t].[Id0], [t].[OwnedReferenceOnBase_Id], [t].[OwnedReferenceOnBase_Name], [t].[Id1], [t].[OwnedReferenceOnDerived_Id], [t].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [d0].[Name] @@ -120,9 +121,9 @@ FROM [BaseEntities] AS [b] ORDER BY [c].[Id], [t].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id]"); } - public override void Include_collection_with_inheritance() + public override async Task Include_collection_with_inheritance(bool async) { - base.Include_collection_with_inheritance(); + await base.Include_collection_with_inheritance(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -144,9 +145,9 @@ FROM [BaseCollectionsOnBase] AS [b1] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [t].[Id]"); } - public override void Include_collection_with_inheritance_on_derived1() + public override async Task Include_collection_with_inheritance_on_derived1(bool async) { - base.Include_collection_with_inheritance_on_derived1(); + await base.Include_collection_with_inheritance_on_derived1(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [d0].[Name], [t].[Id], [t].[BaseParentId], [t].[Name], [t].[DerivedProperty], [t].[IsDerivedCollectionOnBase] @@ -165,9 +166,9 @@ FROM [BaseCollectionsOnBase] AS [b1] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [t].[Id]"); } - public override void Include_collection_with_inheritance_on_derived2() + public override async Task Include_collection_with_inheritance_on_derived2(bool async) { - base.Include_collection_with_inheritance_on_derived2(); + await base.Include_collection_with_inheritance_on_derived2(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [d0].[Name], [t].[Id], [t].[Name], [t].[ParentId], [t].[DerivedInheritanceRelationshipEntityId], [t].[IsDerivedCollectionOnDerived] @@ -186,9 +187,9 @@ FROM [BaseCollectionsOnDerived] AS [b1] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [t].[Id]"); } - public override void Include_collection_with_inheritance_on_derived3() + public override async Task Include_collection_with_inheritance_on_derived3(bool async) { - base.Include_collection_with_inheritance_on_derived3(); + await base.Include_collection_with_inheritance_on_derived3(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [d0].[Name], [t].[Id], [t].[Name], [t].[ParentId], [t].[DerivedInheritanceRelationshipEntityId] @@ -204,9 +205,9 @@ FROM [BaseCollectionsOnDerived] AS [b1] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [t].[Id]"); } - public override void Include_collection_with_inheritance_on_derived_reverse() + public override async Task Include_collection_with_inheritance_on_derived_reverse(bool async) { - base.Include_collection_with_inheritance_on_derived_reverse(); + await base.Include_collection_with_inheritance_on_derived_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [b].[ParentId], [d].[DerivedInheritanceRelationshipEntityId], CASE @@ -225,9 +226,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_collection_with_inheritance_reverse() + public override async Task Include_collection_with_inheritance_reverse(bool async) { - base.Include_collection_with_inheritance_reverse(); + await base.Include_collection_with_inheritance_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Name], [d].[DerivedProperty], CASE @@ -249,9 +250,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_collection_with_inheritance_with_filter() + public override async Task Include_collection_with_inheritance_with_filter(bool async) { - base.Include_collection_with_inheritance_with_filter(); + await base.Include_collection_with_inheritance_with_filter(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -274,9 +275,9 @@ FROM [BaseCollectionsOnBase] AS [b1] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [t].[Id]"); } - public override void Include_collection_with_inheritance_with_filter_reverse() + public override async Task Include_collection_with_inheritance_with_filter_reverse(bool async) { - base.Include_collection_with_inheritance_with_filter_reverse(); + await base.Include_collection_with_inheritance_with_filter_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Name], [d].[DerivedProperty], CASE @@ -299,9 +300,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_reference_without_inheritance() + public override async Task Include_reference_without_inheritance(bool async) { - base.Include_reference_without_inheritance(); + await base.Include_reference_without_inheritance(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -316,9 +317,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [r].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id]"); } - public override void Include_reference_without_inheritance_on_derived1() + public override async Task Include_reference_without_inheritance_on_derived1(bool async) { - base.Include_reference_without_inheritance_on_derived1(); + await base.Include_reference_without_inheritance_on_derived1(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [r].[Id], [r].[Name], [r].[ParentId], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [d0].[Name] @@ -330,9 +331,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [r].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id]"); } - public override void Include_reference_without_inheritance_on_derived2() + public override async Task Include_reference_without_inheritance_on_derived2(bool async) { - base.Include_reference_without_inheritance_on_derived2(); + await base.Include_reference_without_inheritance_on_derived2(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [r].[Id], [r].[Name], [r].[ParentId], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [d0].[Name] @@ -344,9 +345,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [r].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id]"); } - public override void Include_reference_without_inheritance_on_derived_reverse() + public override async Task Include_reference_without_inheritance_on_derived_reverse(bool async) { - base.Include_reference_without_inheritance_on_derived_reverse(); + await base.Include_reference_without_inheritance_on_derived_reverse(async); AssertSql( @"SELECT [r].[Id], [r].[Name], [r].[ParentId], [t].[Id], [t].[Name], [t].[BaseId], [t].[Id0], [t].[OwnedReferenceOnBase_Id], [t].[OwnedReferenceOnBase_Name], [t].[Id1], [t].[OwnedReferenceOnDerived_Id], [t].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [d0].[Name] @@ -361,9 +362,9 @@ FROM [BaseEntities] AS [b] ORDER BY [r].[Id], [t].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id]"); } - public override void Include_reference_without_inheritance_reverse() + public override async Task Include_reference_without_inheritance_reverse(bool async) { - base.Include_reference_without_inheritance_reverse(); + await base.Include_reference_without_inheritance_reverse(async); AssertSql( @"SELECT [r].[Id], [r].[Name], [r].[ParentId], [t].[Id], [t].[Name], [t].[BaseId], [t].[IsDerivedInheritanceRelationshipEntity], [t].[Id0], [t].[OwnedReferenceOnBase_Id], [t].[OwnedReferenceOnBase_Name], [t].[Id1], [t].[OwnedReferenceOnDerived_Id], [t].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [d0].[Name] @@ -381,9 +382,9 @@ FROM [BaseEntities] AS [b] ORDER BY [r].[Id], [t].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id]"); } - public override void Include_reference_without_inheritance_with_filter() + public override async Task Include_reference_without_inheritance_with_filter(bool async) { - base.Include_reference_without_inheritance_with_filter(); + await base.Include_reference_without_inheritance_with_filter(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -399,9 +400,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [r].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id]"); } - public override void Include_reference_without_inheritance_with_filter_reverse() + public override async Task Include_reference_without_inheritance_with_filter_reverse(bool async) { - base.Include_reference_without_inheritance_with_filter_reverse(); + await base.Include_reference_without_inheritance_with_filter_reverse(async); AssertSql( @"SELECT [r].[Id], [r].[Name], [r].[ParentId], [t].[Id], [t].[Name], [t].[BaseId], [t].[IsDerivedInheritanceRelationshipEntity], [t].[Id0], [t].[OwnedReferenceOnBase_Id], [t].[OwnedReferenceOnBase_Name], [t].[Id1], [t].[OwnedReferenceOnDerived_Id], [t].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [d0].[Name] @@ -420,9 +421,9 @@ FROM [BaseEntities] AS [b] ORDER BY [r].[Id], [t].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id]"); } - public override void Include_reference_with_inheritance() + public override async Task Include_reference_with_inheritance(bool async) { - base.Include_reference_with_inheritance(); + await base.Include_reference_with_inheritance(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -444,9 +445,9 @@ FROM [BaseReferencesOnBase] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_reference_with_inheritance_on_derived1() + public override async Task Include_reference_with_inheritance_on_derived1(bool async) { - base.Include_reference_with_inheritance_on_derived1(); + await base.Include_reference_with_inheritance_on_derived1(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [t].[Id], [t].[BaseParentId], [t].[Name], [t].[IsDerivedReferenceOnBase], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name] @@ -465,9 +466,9 @@ FROM [BaseReferencesOnBase] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_reference_with_inheritance_on_derived2() + public override async Task Include_reference_with_inheritance_on_derived2(bool async) { - base.Include_reference_with_inheritance_on_derived2(); + await base.Include_reference_with_inheritance_on_derived2(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [t].[Id], [t].[BaseParentId], [t].[Name], [t].[DerivedInheritanceRelationshipEntityId], [t].[IsDerivedReferenceOnDerived], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name] @@ -486,9 +487,9 @@ FROM [BaseReferencesOnDerived] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_reference_with_inheritance_on_derived4() + public override async Task Include_reference_with_inheritance_on_derived4(bool async) { - base.Include_reference_with_inheritance_on_derived4(); + await base.Include_reference_with_inheritance_on_derived4(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [t].[Id], [t].[BaseParentId], [t].[Name], [t].[DerivedInheritanceRelationshipEntityId], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name] @@ -504,9 +505,9 @@ FROM [BaseReferencesOnDerived] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_reference_with_inheritance_on_derived_reverse() + public override async Task Include_reference_with_inheritance_on_derived_reverse(bool async) { - base.Include_reference_with_inheritance_on_derived_reverse(); + await base.Include_reference_with_inheritance_on_derived_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Name], [d].[DerivedInheritanceRelationshipEntityId], CASE @@ -525,9 +526,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_reference_with_inheritance_on_derived_with_filter1() + public override async Task Include_reference_with_inheritance_on_derived_with_filter1(bool async) { - base.Include_reference_with_inheritance_on_derived_with_filter1(); + await base.Include_reference_with_inheritance_on_derived_with_filter1(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [t].[Id], [t].[BaseParentId], [t].[Name], [t].[IsDerivedReferenceOnBase], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name] @@ -547,9 +548,9 @@ FROM [BaseReferencesOnBase] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_reference_with_inheritance_on_derived_with_filter2() + public override async Task Include_reference_with_inheritance_on_derived_with_filter2(bool async) { - base.Include_reference_with_inheritance_on_derived_with_filter2(); + await base.Include_reference_with_inheritance_on_derived_with_filter2(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [t].[Id], [t].[BaseParentId], [t].[Name], [t].[DerivedInheritanceRelationshipEntityId], [t].[IsDerivedReferenceOnDerived], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name] @@ -569,9 +570,9 @@ FROM [BaseReferencesOnDerived] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_reference_with_inheritance_on_derived_with_filter4() + public override async Task Include_reference_with_inheritance_on_derived_with_filter4(bool async) { - base.Include_reference_with_inheritance_on_derived_with_filter4(); + await base.Include_reference_with_inheritance_on_derived_with_filter4(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [t].[Id], [t].[BaseParentId], [t].[Name], [t].[DerivedInheritanceRelationshipEntityId], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name] @@ -588,9 +589,9 @@ FROM [BaseReferencesOnDerived] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_reference_with_inheritance_on_derived_with_filter_reverse() + public override async Task Include_reference_with_inheritance_on_derived_with_filter_reverse(bool async) { - base.Include_reference_with_inheritance_on_derived_with_filter_reverse(); + await base.Include_reference_with_inheritance_on_derived_with_filter_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Name], [d].[DerivedInheritanceRelationshipEntityId], CASE @@ -610,9 +611,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_reference_with_inheritance_reverse() + public override async Task Include_reference_with_inheritance_reverse(bool async) { - base.Include_reference_with_inheritance_reverse(); + await base.Include_reference_with_inheritance_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Name], CASE @@ -634,9 +635,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_reference_with_inheritance_with_filter() + public override async Task Include_reference_with_inheritance_with_filter(bool async) { - base.Include_reference_with_inheritance_with_filter(); + await base.Include_reference_with_inheritance_with_filter(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -659,9 +660,9 @@ FROM [BaseReferencesOnBase] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_reference_with_inheritance_with_filter_reverse() + public override async Task Include_reference_with_inheritance_with_filter_reverse(bool async) { - base.Include_reference_with_inheritance_with_filter_reverse(); + await base.Include_reference_with_inheritance_with_filter_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Name], CASE @@ -684,9 +685,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_self_reference_with_inheritance() + public override async Task Include_self_reference_with_inheritance(bool async) { - base.Include_self_reference_with_inheritance(); + await base.Include_self_reference_with_inheritance(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -707,9 +708,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id]"); } - public override void Include_self_reference_with_inheritance_reverse() + public override async Task Include_self_reference_with_inheritance_reverse(bool async) { - base.Include_self_reference_with_inheritance_reverse(); + await base.Include_self_reference_with_inheritance_reverse(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [t].[Id], [t].[Name], [t].[BaseId], [t].[IsDerivedInheritanceRelationshipEntity], [t].[Id0], [t].[OwnedReferenceOnBase_Id], [t].[OwnedReferenceOnBase_Name], [t].[Id1], [t].[OwnedReferenceOnDerived_Id], [t].[OwnedReferenceOnDerived_Name], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name], [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name] @@ -730,9 +731,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id]"); } - public override void Nested_include_collection_reference_on_non_entity_base() + public override async Task Nested_include_collection_reference_on_non_entity_base(bool async) { - base.Nested_include_collection_reference_on_non_entity_base(); + await base.Nested_include_collection_reference_on_non_entity_base(async); AssertSql( @"SELECT [r].[Id], [r].[Name], [t].[Id], [t].[Name], [t].[ReferenceId], [t].[ReferencedEntityId], [t].[Id0], [t].[Name0] @@ -745,9 +746,9 @@ FROM [PrincipalEntities] AS [p] ORDER BY [r].[Id], [t].[Id], [t].[Id0]"); } - public override void Nested_include_with_inheritance_collection_collection() + public override async Task Nested_include_with_inheritance_collection_collection(bool async) { - base.Nested_include_with_inheritance_collection_collection(); + await base.Nested_include_with_inheritance_collection_collection(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -777,9 +778,9 @@ FROM [NestedCollections] AS [n] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [t0].[Id], [t0].[Id0]"); } - public override void Nested_include_with_inheritance_collection_collection_reverse() + public override async Task Nested_include_with_inheritance_collection_collection_reverse(bool async) { - base.Nested_include_with_inheritance_collection_collection_reverse(); + await base.Nested_include_with_inheritance_collection_collection_reverse(async); AssertSql( @"SELECT [n].[Id], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], CASE @@ -809,9 +810,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [n].[Id], [t].[Id], [t0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Nested_include_with_inheritance_collection_reference() + public override async Task Nested_include_with_inheritance_collection_reference(bool async) { - base.Nested_include_with_inheritance_collection_reference(); + await base.Nested_include_with_inheritance_collection_reference(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -841,9 +842,9 @@ FROM [NestedReferences] AS [n] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [t0].[Id], [t0].[Id0]"); } - public override void Nested_include_with_inheritance_collection_reference_reverse() + public override async Task Nested_include_with_inheritance_collection_reference_reverse(bool async) { - base.Nested_include_with_inheritance_collection_reference_reverse(); + await base.Nested_include_with_inheritance_collection_reference_reverse(async); AssertSql( @"SELECT [n].[Id], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], CASE @@ -873,9 +874,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [n].[Id], [t].[Id], [t0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Nested_include_with_inheritance_reference_collection() + public override async Task Nested_include_with_inheritance_reference_collection(bool async) { - base.Nested_include_with_inheritance_reference_collection(); + await base.Nested_include_with_inheritance_reference_collection(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -905,9 +906,9 @@ FROM [NestedCollections] AS [n] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [t0].[Id]"); } - public override void Nested_include_with_inheritance_reference_collection_on_base() + public override async Task Nested_include_with_inheritance_reference_collection_on_base(bool async) { - base.Nested_include_with_inheritance_reference_collection_on_base(); + await base.Nested_include_with_inheritance_reference_collection_on_base(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [t].[Id], [t].[BaseParentId], [t].[Name], [t].[IsDerivedReferenceOnBase], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name], [t0].[Id], [t0].[Name], [t0].[ParentCollectionId], [t0].[ParentReferenceId], [t0].[IsNestedCollectionDerived] @@ -934,9 +935,9 @@ FROM [NestedCollections] AS [n] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [t0].[Id]"); } - public override void Nested_include_with_inheritance_reference_collection_reverse() + public override async Task Nested_include_with_inheritance_reference_collection_reverse(bool async) { - base.Nested_include_with_inheritance_reference_collection_reverse(); + await base.Nested_include_with_inheritance_reference_collection_reverse(async); AssertSql( @"SELECT [n].[Id], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], CASE @@ -966,9 +967,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [n].[Id], [t].[Id], [t0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Nested_include_with_inheritance_reference_reference() + public override async Task Nested_include_with_inheritance_reference_reference(bool async) { - base.Nested_include_with_inheritance_reference_reference(); + await base.Nested_include_with_inheritance_reference_reference(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -998,9 +999,9 @@ FROM [NestedReferences] AS [n] ORDER BY [b].[Id], [t].[Id], [t0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Nested_include_with_inheritance_reference_reference_on_base() + public override async Task Nested_include_with_inheritance_reference_reference_on_base(bool async) { - base.Nested_include_with_inheritance_reference_reference_on_base(); + await base.Nested_include_with_inheritance_reference_reference_on_base(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [t].[Id], [t].[BaseParentId], [t].[Name], [t].[IsDerivedReferenceOnBase], [t0].[Id], [t0].[Name], [t0].[ParentCollectionId], [t0].[ParentReferenceId], [t0].[IsNestedReferenceDerived], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name] @@ -1027,9 +1028,9 @@ FROM [NestedReferences] AS [n] ORDER BY [b].[Id], [t].[Id], [t0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Nested_include_with_inheritance_reference_reference_reverse() + public override async Task Nested_include_with_inheritance_reference_reference_reverse(bool async) { - base.Nested_include_with_inheritance_reference_reference_reverse(); + await base.Nested_include_with_inheritance_reference_reference_reverse(async); AssertSql( @"SELECT [n].[Id], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], CASE @@ -1059,9 +1060,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [n].[Id], [t].[Id], [t0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_collection_with_inheritance_split() + public override async Task Include_collection_with_inheritance_split(bool async) { - base.Include_collection_with_inheritance_split(); + await base.Include_collection_with_inheritance_split(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -1083,9 +1084,9 @@ FROM [BaseCollectionsOnBase] AS [b1] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [t].[Id]"); } - public override void Include_collection_with_inheritance_reverse_split() + public override async Task Include_collection_with_inheritance_reverse_split(bool async) { - base.Include_collection_with_inheritance_reverse_split(); + await base.Include_collection_with_inheritance_reverse_split(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Name], [d].[DerivedProperty], CASE @@ -1107,9 +1108,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_collection_with_inheritance_with_filter_split() + public override async Task Include_collection_with_inheritance_with_filter_split(bool async) { - base.Include_collection_with_inheritance_with_filter_split(); + await base.Include_collection_with_inheritance_with_filter_split(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -1132,9 +1133,9 @@ FROM [BaseCollectionsOnBase] AS [b1] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [t].[Id]"); } - public override void Include_collection_with_inheritance_with_filter_reverse_split() + public override async Task Include_collection_with_inheritance_with_filter_reverse_split(bool async) { - base.Include_collection_with_inheritance_with_filter_reverse_split(); + await base.Include_collection_with_inheritance_with_filter_reverse_split(async); AssertSql( @"SELECT [b].[Id], [b].[BaseParentId], [b].[Name], [d].[DerivedProperty], CASE @@ -1157,9 +1158,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Include_collection_without_inheritance_split() + public override async Task Include_collection_without_inheritance_split(bool async) { - base.Include_collection_without_inheritance_split(); + await base.Include_collection_without_inheritance_split(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -1174,9 +1175,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [c].[Id]"); } - public override void Include_collection_without_inheritance_reverse_split() + public override async Task Include_collection_without_inheritance_reverse_split(bool async) { - base.Include_collection_without_inheritance_reverse_split(); + await base.Include_collection_without_inheritance_reverse_split(async); AssertSql( @"SELECT [c].[Id], [c].[Name], [c].[ParentId], [t].[Id], [t].[Name], [t].[BaseId], [t].[IsDerivedInheritanceRelationshipEntity], [t].[Id0], [t].[OwnedReferenceOnBase_Id], [t].[OwnedReferenceOnBase_Name], [t].[Id1], [t].[OwnedReferenceOnDerived_Id], [t].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [d0].[Name] @@ -1194,9 +1195,9 @@ FROM [BaseEntities] AS [b] ORDER BY [c].[Id], [t].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id]"); } - public override void Include_collection_without_inheritance_with_filter_split() + public override async Task Include_collection_without_inheritance_with_filter_split(bool async) { - base.Include_collection_without_inheritance_with_filter_split(); + await base.Include_collection_without_inheritance_with_filter_split(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -1212,9 +1213,9 @@ FROM [BaseEntities] AS [b] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [c].[Id]"); } - public override void Include_collection_without_inheritance_with_filter_reverse_split() + public override async Task Include_collection_without_inheritance_with_filter_reverse_split(bool async) { - base.Include_collection_without_inheritance_with_filter_reverse_split(); + await base.Include_collection_without_inheritance_with_filter_reverse_split(async); AssertSql( @"SELECT [c].[Id], [c].[Name], [c].[ParentId], [t].[Id], [t].[Name], [t].[BaseId], [t].[IsDerivedInheritanceRelationshipEntity], [t].[Id0], [t].[OwnedReferenceOnBase_Id], [t].[OwnedReferenceOnBase_Name], [t].[Id1], [t].[OwnedReferenceOnDerived_Id], [t].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [d0].[Name] @@ -1233,9 +1234,9 @@ FROM [BaseEntities] AS [b] ORDER BY [c].[Id], [t].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id]"); } - public override void Include_collection_with_inheritance_on_derived1_split() + public override async Task Include_collection_with_inheritance_on_derived1_split(bool async) { - base.Include_collection_with_inheritance_on_derived1_split(); + await base.Include_collection_with_inheritance_on_derived1_split(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [d0].[Name], [t].[Id], [t].[BaseParentId], [t].[Name], [t].[DerivedProperty], [t].[IsDerivedCollectionOnBase] @@ -1254,9 +1255,9 @@ FROM [BaseCollectionsOnBase] AS [b1] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [t].[Id]"); } - public override void Include_collection_with_inheritance_on_derived2_split() + public override async Task Include_collection_with_inheritance_on_derived2_split(bool async) { - base.Include_collection_with_inheritance_on_derived2_split(); + await base.Include_collection_with_inheritance_on_derived2_split(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [d0].[Name], [t].[Id], [t].[Name], [t].[ParentId], [t].[DerivedInheritanceRelationshipEntityId], [t].[IsDerivedCollectionOnDerived] @@ -1275,9 +1276,9 @@ FROM [BaseCollectionsOnDerived] AS [b1] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [t].[Id]"); } - public override void Include_collection_with_inheritance_on_derived3_split() + public override async Task Include_collection_with_inheritance_on_derived3_split(bool async) { - base.Include_collection_with_inheritance_on_derived3_split(); + await base.Include_collection_with_inheritance_on_derived3_split(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [d0].[Name], [t].[Id], [t].[Name], [t].[ParentId], [t].[DerivedInheritanceRelationshipEntityId] @@ -1293,9 +1294,9 @@ FROM [BaseCollectionsOnDerived] AS [b1] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [t].[Id]"); } - public override void Include_collection_with_inheritance_on_derived_reverse_split() + public override async Task Include_collection_with_inheritance_on_derived_reverse_split(bool async) { - base.Include_collection_with_inheritance_on_derived_reverse_split(); + await base.Include_collection_with_inheritance_on_derived_reverse_split(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [b].[ParentId], [d].[DerivedInheritanceRelationshipEntityId], CASE @@ -1314,9 +1315,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Nested_include_with_inheritance_reference_collection_split() + public override async Task Nested_include_with_inheritance_reference_collection_split(bool async) { - base.Nested_include_with_inheritance_reference_collection_split(); + await base.Nested_include_with_inheritance_reference_collection_split(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -1346,9 +1347,9 @@ FROM [NestedCollections] AS [n] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [t0].[Id]"); } - public override void Nested_include_with_inheritance_reference_collection_on_base_split() + public override async Task Nested_include_with_inheritance_reference_collection_on_base_split(bool async) { - base.Nested_include_with_inheritance_reference_collection_on_base_split(); + await base.Nested_include_with_inheritance_reference_collection_on_base_split(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [t].[Id], [t].[BaseParentId], [t].[Name], [t].[IsDerivedReferenceOnBase], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name], [t0].[Id], [t0].[Name], [t0].[ParentCollectionId], [t0].[ParentReferenceId], [t0].[IsNestedCollectionDerived] @@ -1375,9 +1376,9 @@ FROM [NestedCollections] AS [n] ORDER BY [b].[Id], [t].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [t0].[Id]"); } - public override void Nested_include_with_inheritance_reference_collection_reverse_split() + public override async Task Nested_include_with_inheritance_reference_collection_reverse_split(bool async) { - base.Nested_include_with_inheritance_reference_collection_reverse_split(); + await base.Nested_include_with_inheritance_reference_collection_reverse_split(async); AssertSql( @"SELECT [n].[Id], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], CASE @@ -1407,9 +1408,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [n].[Id], [t].[Id], [t0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Nested_include_with_inheritance_collection_reference_split() + public override async Task Nested_include_with_inheritance_collection_reference_split(bool async) { - base.Nested_include_with_inheritance_collection_reference_split(); + await base.Nested_include_with_inheritance_collection_reference_split(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -1439,9 +1440,9 @@ FROM [NestedReferences] AS [n] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [t0].[Id], [t0].[Id0]"); } - public override void Nested_include_with_inheritance_collection_reference_reverse_split() + public override async Task Nested_include_with_inheritance_collection_reference_reverse_split(bool async) { - base.Nested_include_with_inheritance_collection_reference_reverse_split(); + await base.Nested_include_with_inheritance_collection_reference_reverse_split(async); AssertSql( @"SELECT [n].[Id], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], CASE @@ -1471,9 +1472,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [n].[Id], [t].[Id], [t0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Nested_include_with_inheritance_collection_collection_split() + public override async Task Nested_include_with_inheritance_collection_collection_split(bool async) { - base.Nested_include_with_inheritance_collection_collection_split(); + await base.Nested_include_with_inheritance_collection_collection_split(async); AssertSql( @"SELECT [b].[Id], [b].[Name], [d].[BaseId], CASE @@ -1503,9 +1504,9 @@ FROM [NestedCollections] AS [n] ORDER BY [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId], [d0].[Id], [t0].[Id], [t0].[Id0]"); } - public override void Nested_include_with_inheritance_collection_collection_reverse_split() + public override async Task Nested_include_with_inheritance_collection_collection_reverse_split(bool async) { - base.Nested_include_with_inheritance_collection_collection_reverse_split(); + await base.Nested_include_with_inheritance_collection_collection_reverse_split(async); AssertSql( @"SELECT [n].[Id], [n].[Name], [n].[ParentCollectionId], [n].[ParentReferenceId], CASE @@ -1535,9 +1536,9 @@ FROM [BaseEntities] AS [b0] ORDER BY [n].[Id], [t].[Id], [t0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id]"); } - public override void Nested_include_collection_reference_on_non_entity_base_split() + public override async Task Nested_include_collection_reference_on_non_entity_base_split(bool async) { - base.Nested_include_collection_reference_on_non_entity_base_split(); + await base.Nested_include_collection_reference_on_non_entity_base_split(async); AssertSql( @"SELECT [r].[Id], [r].[Name], [t].[Id], [t].[Name], [t].[ReferenceId], [t].[ReferencedEntityId], [t].[Id0], [t].[Name0]