@@ -44,47 +44,72 @@ public override ConventionSet CreateConventionSet()
44
44
45
45
var storeKeyConvention = new StoreKeyConvention ( Dependencies ) ;
46
46
var discriminatorConvention = new CosmosDiscriminatorConvention ( Dependencies ) ;
47
- var keyDiscoveryConvention = new CosmosKeyDiscoveryConvention ( Dependencies ) ;
47
+ KeyDiscoveryConvention keyDiscoveryConvention = new CosmosKeyDiscoveryConvention ( Dependencies ) ;
48
+ InversePropertyAttributeConvention inversePropertyAttributeConvention =
49
+ new CosmosInversePropertyAttributeConvention ( Dependencies ) ;
50
+ RelationshipDiscoveryConvention relationshipDiscoveryConvention =
51
+ new CosmosRelationshipDiscoveryConvention ( Dependencies ) ;
48
52
conventionSet . EntityTypeAddedConventions . Add ( storeKeyConvention ) ;
49
53
conventionSet . EntityTypeAddedConventions . Add ( discriminatorConvention ) ;
50
- ReplaceConvention ( conventionSet . EntityTypeAddedConventions , ( KeyDiscoveryConvention ) keyDiscoveryConvention ) ;
54
+ ReplaceConvention ( conventionSet . EntityTypeAddedConventions , keyDiscoveryConvention ) ;
55
+ ReplaceConvention ( conventionSet . EntityTypeAddedConventions , inversePropertyAttributeConvention ) ;
56
+ ReplaceConvention ( conventionSet . EntityTypeAddedConventions , relationshipDiscoveryConvention ) ;
57
+
58
+ ReplaceConvention ( conventionSet . EntityTypeIgnoredConventions , relationshipDiscoveryConvention ) ;
51
59
52
60
ReplaceConvention ( conventionSet . EntityTypeRemovedConventions , ( DiscriminatorConvention ) discriminatorConvention ) ;
61
+ ReplaceConvention ( conventionSet . EntityTypeRemovedConventions , inversePropertyAttributeConvention ) ;
53
62
54
63
conventionSet . EntityTypeBaseTypeChangedConventions . Add ( storeKeyConvention ) ;
55
64
ReplaceConvention ( conventionSet . EntityTypeBaseTypeChangedConventions , ( DiscriminatorConvention ) discriminatorConvention ) ;
56
- ReplaceConvention ( conventionSet . EntityTypeBaseTypeChangedConventions , ( KeyDiscoveryConvention ) keyDiscoveryConvention ) ;
65
+ ReplaceConvention ( conventionSet . EntityTypeBaseTypeChangedConventions , keyDiscoveryConvention ) ;
66
+ ReplaceConvention ( conventionSet . EntityTypeBaseTypeChangedConventions , inversePropertyAttributeConvention ) ;
67
+ ReplaceConvention ( conventionSet . EntityTypeBaseTypeChangedConventions , relationshipDiscoveryConvention ) ;
57
68
58
- ReplaceConvention ( conventionSet . EntityTypeMemberIgnoredConventions , ( KeyDiscoveryConvention ) keyDiscoveryConvention ) ;
69
+ ReplaceConvention ( conventionSet . EntityTypeMemberIgnoredConventions , keyDiscoveryConvention ) ;
70
+ ReplaceConvention ( conventionSet . EntityTypeMemberIgnoredConventions , inversePropertyAttributeConvention ) ;
71
+ ReplaceConvention ( conventionSet . EntityTypeMemberIgnoredConventions , relationshipDiscoveryConvention ) ;
59
72
60
73
conventionSet . EntityTypePrimaryKeyChangedConventions . Add ( storeKeyConvention ) ;
61
74
62
75
conventionSet . KeyAddedConventions . Add ( storeKeyConvention ) ;
63
76
64
77
conventionSet . KeyRemovedConventions . Add ( storeKeyConvention ) ;
65
- ReplaceConvention ( conventionSet . KeyRemovedConventions , ( KeyDiscoveryConvention ) keyDiscoveryConvention ) ;
78
+ ReplaceConvention ( conventionSet . KeyRemovedConventions , keyDiscoveryConvention ) ;
66
79
67
- ReplaceConvention ( conventionSet . ForeignKeyAddedConventions , ( KeyDiscoveryConvention ) keyDiscoveryConvention ) ;
80
+ ReplaceConvention ( conventionSet . ForeignKeyAddedConventions , keyDiscoveryConvention ) ;
68
81
82
+ ReplaceConvention ( conventionSet . ForeignKeyRemovedConventions , relationshipDiscoveryConvention ) ;
69
83
conventionSet . ForeignKeyRemovedConventions . Add ( discriminatorConvention ) ;
70
84
conventionSet . ForeignKeyRemovedConventions . Add ( storeKeyConvention ) ;
71
- ReplaceConvention ( conventionSet . ForeignKeyRemovedConventions , ( KeyDiscoveryConvention ) keyDiscoveryConvention ) ;
85
+ ReplaceConvention ( conventionSet . ForeignKeyRemovedConventions , keyDiscoveryConvention ) ;
72
86
73
- ReplaceConvention ( conventionSet . ForeignKeyPropertiesChangedConventions , ( KeyDiscoveryConvention ) keyDiscoveryConvention ) ;
87
+ ReplaceConvention ( conventionSet . ForeignKeyPropertiesChangedConventions , keyDiscoveryConvention ) ;
74
88
75
- ReplaceConvention ( conventionSet . ForeignKeyUniquenessChangedConventions , ( KeyDiscoveryConvention ) keyDiscoveryConvention ) ;
89
+ ReplaceConvention ( conventionSet . ForeignKeyUniquenessChangedConventions , keyDiscoveryConvention ) ;
76
90
77
91
conventionSet . ForeignKeyOwnershipChangedConventions . Add ( discriminatorConvention ) ;
78
92
conventionSet . ForeignKeyOwnershipChangedConventions . Add ( storeKeyConvention ) ;
79
- ReplaceConvention ( conventionSet . ForeignKeyOwnershipChangedConventions , ( KeyDiscoveryConvention ) keyDiscoveryConvention ) ;
93
+ ReplaceConvention ( conventionSet . ForeignKeyOwnershipChangedConventions , keyDiscoveryConvention ) ;
94
+ ReplaceConvention ( conventionSet . ForeignKeyOwnershipChangedConventions , relationshipDiscoveryConvention ) ;
95
+
96
+ ReplaceConvention ( conventionSet . ForeignKeyNullNavigationSetConventions , relationshipDiscoveryConvention ) ;
97
+
98
+ ReplaceConvention ( conventionSet . NavigationAddedConventions , inversePropertyAttributeConvention ) ;
99
+ ReplaceConvention ( conventionSet . NavigationAddedConventions , relationshipDiscoveryConvention ) ;
80
100
101
+ ReplaceConvention ( conventionSet . NavigationRemovedConventions , relationshipDiscoveryConvention ) ;
102
+
103
+ conventionSet . EntityTypeAnnotationChangedConventions . Add ( discriminatorConvention ) ;
81
104
conventionSet . EntityTypeAnnotationChangedConventions . Add ( storeKeyConvention ) ;
82
- conventionSet . EntityTypeAnnotationChangedConventions . Add ( keyDiscoveryConvention ) ;
105
+ conventionSet . EntityTypeAnnotationChangedConventions . Add ( ( CosmosKeyDiscoveryConvention ) keyDiscoveryConvention ) ;
83
106
84
- ReplaceConvention ( conventionSet . PropertyAddedConventions , ( KeyDiscoveryConvention ) keyDiscoveryConvention ) ;
107
+ ReplaceConvention ( conventionSet . PropertyAddedConventions , keyDiscoveryConvention ) ;
85
108
86
109
conventionSet . PropertyAnnotationChangedConventions . Add ( storeKeyConvention ) ;
87
110
111
+ ReplaceConvention ( conventionSet . ModelFinalizingConventions , inversePropertyAttributeConvention ) ;
112
+
88
113
return conventionSet ;
89
114
}
90
115
0 commit comments