1515
1616//$Authors = Niek Schoemaker (@niekschoemaker)
1717
18+ using FirebirdSql . EntityFrameworkCore . Firebird . FunctionalTests . Helpers ;
1819using FirebirdSql . EntityFrameworkCore . Firebird . FunctionalTests . TestUtilities ;
1920using Microsoft . EntityFrameworkCore ;
20- using Microsoft . EntityFrameworkCore . Query . Associations ;
2121using Microsoft . EntityFrameworkCore . Query . Associations . OwnedNavigations ;
2222using Microsoft . EntityFrameworkCore . TestUtilities ;
2323
@@ -32,61 +32,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con
3232 {
3333 base . OnModelCreating ( modelBuilder , context ) ;
3434
35- // This directly overrides the Table names from OwnedNavigationsRelationalFixtureBase
36- // This is needed as it otherwise exceeds the column length of Firebird 3 & 4.
37- modelBuilder . Entity < RootEntity > ( b =>
38- {
39- b . OwnsOne (
40- e => e . RequiredAssociate , rrb =>
41- {
42- rrb . OwnsMany (
43- r => r . NestedCollection , rcb =>
44- {
45- rcb . ToTable ( "RR_NC" ) ; // RequiredRelated_NestedCollection
46- } ) ;
47- } ) ;
48-
49- b . OwnsOne (
50- e => e . OptionalAssociate , orb =>
51- {
52- orb . OwnsMany (
53- r => r . NestedCollection , rcb =>
54- {
55- rcb . ToTable ( "OR_NC" ) ; // OptionalRelated_NestedCollection
56- } ) ;
57- } ) ;
58-
59- b . OwnsMany (
60- e => e . AssociateCollection , rcb =>
61- {
62- rcb . OwnsMany (
63- r => r . NestedCollection , rcb =>
64- {
65- rcb . ToTable ( "RC_NC" ) ; // RelatedCollection_NestedCollection
66- } ) ;
67- } ) ;
68-
69-
70- b . OwnsOne (
71- e => e . RequiredAssociate , rrb =>
72- {
73- rrb . OwnsOne ( r => r . RequiredNestedAssociate , rnb => rnb . ToTable ( "RR_RN" ) ) ; // RequiredRelated_RequiredNested
74- rrb . OwnsOne ( r => r . OptionalNestedAssociate , rnb => rnb . ToTable ( "RR_ON" ) ) ; // RequiredRelated_OptionalNested
75- } ) ;
76-
77- b . OwnsOne (
78- e => e . OptionalAssociate , rrb =>
79- {
80- rrb . OwnsOne ( r => r . RequiredNestedAssociate , rnb => rnb . ToTable ( "OR_RN" ) ) ; // OptionalRelated_RequiredNested
81- rrb . OwnsOne ( r => r . OptionalNestedAssociate , rnb => rnb . ToTable ( "OR_ON" ) ) ; // OptionalRelated_OptionalNested
82- } ) ;
83-
84- b . OwnsMany (
85- e => e . AssociateCollection , rcb =>
86- {
87- rcb . OwnsOne ( r => r . RequiredNestedAssociate , rnb => rnb . ToTable ( "RC_RN" ) ) ; // RelatedCollection_RequiredNested
88- rcb . OwnsOne ( r => r . OptionalNestedAssociate , rnb => rnb . ToTable ( "RC_ON" ) ) ; // RelatedCollection_OptionalNested
89- } ) ;
90- } ) ;
35+ ModelHelpers . SimpleTableNames ( modelBuilder ) ;
9136 }
9237}
0 commit comments