@@ -33,7 +33,12 @@ public ExtensionInfo(IDbContextOptionsExtension extension) : base(extension) {}
33
33
34
34
public override string LogFragment => "Snake Case Extension" ;
35
35
36
- public override long GetServiceProviderHashCode ( ) => 0 ;
36
+ public override int GetServiceProviderHashCode ( ) => 0 ;
37
+
38
+ public override bool ShouldUseSameServiceProvider ( DbContextOptionsExtensionInfo other )
39
+ {
40
+ return false ;
41
+ }
37
42
38
43
public override void PopulateDebugInfo ( IDictionary < string , string > debugInfo )
39
44
{
@@ -118,26 +123,26 @@ public virtual void ProcessEntityTypeAdded(
118
123
119
124
if ( entityType . BaseType is null )
120
125
{
121
- entityTypeBuilder . ToTable ( RewriteName ( entityType . GetTableName ( ) ) , entityType . GetSchema ( ) ) ;
126
+ entityTypeBuilder . ToTable ( RewriteName ( entityType . GetTableName ( ) ! ) , entityType . GetSchema ( ) ) ;
122
127
123
128
if ( entityType . GetViewNameConfigurationSource ( ) == ConfigurationSource . Convention )
124
129
{
125
- entityTypeBuilder . ToView ( RewriteName ( entityType . GetViewName ( ) ) , entityType . GetViewSchema ( ) ) ;
130
+ entityTypeBuilder . ToView ( RewriteName ( entityType . GetViewName ( ) ! ) , entityType . GetViewSchema ( ) ) ;
126
131
}
127
132
}
128
133
}
129
134
130
135
public void ProcessEntityTypeBaseTypeChanged (
131
136
IConventionEntityTypeBuilder entityTypeBuilder ,
132
- IConventionEntityType newBaseType ,
133
- IConventionEntityType oldBaseType ,
137
+ IConventionEntityType ? newBaseType ,
138
+ IConventionEntityType ? oldBaseType ,
134
139
IConventionContext < IConventionEntityType > context )
135
140
{
136
141
var entityType = entityTypeBuilder . Metadata ;
137
142
138
143
if ( newBaseType is null )
139
144
{
140
- entityTypeBuilder . ToTable ( RewriteName ( entityType . GetTableName ( ) ) , entityType . GetSchema ( ) ) ;
145
+ entityTypeBuilder . ToTable ( RewriteName ( entityType . GetTableName ( ) ! ) , entityType . GetSchema ( ) ) ;
141
146
}
142
147
else
143
148
{
@@ -173,8 +178,8 @@ public void ProcessForeignKeyOwnershipChanged(IConventionForeignKeyBuilder relat
173
178
public void ProcessEntityTypeAnnotationChanged (
174
179
IConventionEntityTypeBuilder entityTypeBuilder ,
175
180
string name ,
176
- IConventionAnnotation annotation ,
177
- IConventionAnnotation oldAnnotation ,
181
+ IConventionAnnotation ? annotation ,
182
+ IConventionAnnotation ? oldAnnotation ,
178
183
IConventionContext < IConventionAnnotation > context )
179
184
{
180
185
var entityType = entityTypeBuilder . Metadata ;
@@ -216,7 +221,7 @@ public void ProcessEntityTypeAnnotationChanged(
216
221
&& ( string ) annotation . Value != ownership . PrincipalEntityType . GetTableName ( ) )
217
222
{
218
223
foreach ( var property in entityType . GetProperties ( )
219
- . Except ( entityType . FindPrimaryKey ( ) . Properties )
224
+ . Except ( entityType . FindPrimaryKey ( ) ! . Properties )
220
225
. Where ( p => p . Builder . CanSetColumnName ( null ) ) )
221
226
{
222
227
RewriteColumnName ( property . Builder ) ;
@@ -271,7 +276,7 @@ public void ProcessModelFinalizing(IConventionModelBuilder modelBuilder, IConven
271
276
272
277
if ( property . GetColumnNameConfigurationSource ( identifier . Value ) == ConfigurationSource . Convention )
273
278
{
274
- columnName = property . GetColumnName ( identifier . Value ) ;
279
+ columnName = property . GetColumnName ( identifier . Value ) ! ;
275
280
if ( columnName . StartsWith ( entityType . ShortName ( ) + '_' , StringComparison . Ordinal ) )
276
281
{
277
282
property . Builder . HasColumnName (
@@ -314,7 +319,7 @@ private void RewriteColumnName(IConventionPropertyBuilder propertyBuilder)
314
319
if ( name == "Id" )
315
320
name = entityType . GetTableName ( ) + name ;
316
321
propertyBuilder . HasColumnName (
317
- RewriteName ( name ) , identifier . Value ) ;
322
+ RewriteName ( name ! ) , identifier . Value ) ;
318
323
}
319
324
}
320
325
}
0 commit comments