@@ -1099,6 +1099,53 @@ public virtual void Owned_type_collections_can_be_mapped_to_different_tables()
10991099            Assert . Null ( owned . GetSchema ( ) ) ; 
11001100        } 
11011101
1102+         [ ConditionalFact ] 
1103+         public  virtual  void  Owned_type_collections_are_mapped_to_same_tables_by_default ( ) 
1104+         { 
1105+             var  modelBuilder  =  CreateModelBuilder ( ) ; 
1106+ 
1107+             modelBuilder . Entity < JsonEntityWithNesting > ( b => 
1108+             { 
1109+                 b . OwnsOne ( x =>  x . OwnedReference1 ,  bb => 
1110+                 { 
1111+                     bb . OwnsOne ( x =>  x . Reference1 ) ; 
1112+                     bb . OwnsOne ( x =>  x . Reference2 ) ; 
1113+                     bb . OwnsMany ( x =>  x . Collection1 ) ; 
1114+                     bb . OwnsMany ( x =>  x . Collection2 ) ; 
1115+                 } ) ; 
1116+ 
1117+                 b . OwnsOne ( x =>  x . OwnedReference2 ,  bb => 
1118+                 { 
1119+                     bb . OwnsOne ( x =>  x . Reference1 ) ; 
1120+                     bb . OwnsOne ( x =>  x . Reference2 ) ; 
1121+                     bb . OwnsMany ( x =>  x . Collection1 ) ; 
1122+                     bb . OwnsMany ( x =>  x . Collection2 ) ; 
1123+                 } ) ; 
1124+ 
1125+                 b . OwnsMany ( x =>  x . OwnedCollection1 ,  bb => 
1126+                 { 
1127+                     bb . OwnsOne ( x =>  x . Reference1 ) ; 
1128+                     bb . OwnsOne ( x =>  x . Reference2 ) ; 
1129+                     bb . OwnsMany ( x =>  x . Collection1 ) ; 
1130+                     bb . OwnsMany ( x =>  x . Collection2 ) ; 
1131+                 } ) ; 
1132+ 
1133+                 b . OwnsMany ( x =>  x . OwnedCollection2 ,  bb => 
1134+                 { 
1135+                     bb . OwnsOne ( x =>  x . Reference1 ) ; 
1136+                     bb . OwnsOne ( x =>  x . Reference2 ) ; 
1137+                     bb . OwnsMany ( x =>  x . Collection1 ) ; 
1138+                     bb . OwnsMany ( x =>  x . Collection2 ) ; 
1139+                 } ) ; 
1140+             } ) ; 
1141+ 
1142+             Assert . Equal ( RelationalStrings . IncompatibleTableNoRelationship ( 
1143+                 "JsonEntityWithNesting_Collection1" , 
1144+                 "JsonEntityWithNesting.OwnedReference2#OwnedEntityExtraLevel.Collection1#OwnedEntity" , 
1145+                 "JsonEntityWithNesting.OwnedReference1#OwnedEntityExtraLevel.Collection1#OwnedEntity" ) , 
1146+                 Assert . Throws < InvalidOperationException > ( ( )  =>  modelBuilder . FinalizeModel ( ) ) . Message ) ; 
1147+         } 
1148+ 
11021149        [ ConditionalFact ] 
11031150        public  virtual  void  Owned_type_collections_can_be_mapped_to_a_view ( ) 
11041151        { 
@@ -2007,27 +2054,6 @@ public virtual void Json_entity_with_custom_property_names()
20072054                Assert . Equal ( "InnerEnum" ,  ownedEntity . GetProperty ( "Enum" ) . GetJsonPropertyName ( ) ) ; 
20082055            } 
20092056        } 
2010- 
2011-         [ ConditionalFact ] 
2012-         public  virtual  void  Json_entity_and_normal_owned_can_exist_side_to_side_on_same_entity ( ) 
2013-         { 
2014-             var  modelBuilder  =  CreateModelBuilder ( ) ; 
2015- 
2016-             modelBuilder . Entity < JsonEntity > ( b => 
2017-             { 
2018-                 b . OwnsOne ( x =>  x . OwnedReference1 ) ; 
2019-                 b . OwnsOne ( x =>  x . OwnedReference2 ,  bb =>  bb . ToJson ( "reference" ) ) ; 
2020-                 b . OwnsMany ( x =>  x . OwnedCollection1 ) ; 
2021-                 b . OwnsMany ( x =>  x . OwnedCollection2 ,  bb =>  bb . ToJson ( "collection" ) ) ; 
2022-             } ) ; 
2023- 
2024-             var  model  =  modelBuilder . FinalizeModel ( ) ; 
2025- 
2026-             var  ownedEntities  =  model . FindEntityTypes ( typeof ( OwnedEntity ) ) ; 
2027-             Assert . Equal ( 4 ,  ownedEntities . Count ( ) ) ; 
2028-             Assert . Equal ( 2 ,  ownedEntities . Where ( e =>  e . IsMappedToJson ( ) ) . Count ( ) ) ; 
2029-             Assert . Equal ( 2 ,  ownedEntities . Where ( e =>  e . IsOwned ( )  &&  ! e . IsMappedToJson ( ) ) . Count ( ) ) ; 
2030-         } 
20312057    } 
20322058
20332059    public  class  SqlServerModelBuilderFixture  :  RelationalModelBuilderFixture 
0 commit comments