Skip to content

Commit eb28fd3

Browse files
committed
Review updates
1 parent f4e549e commit eb28fd3

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/EFCore.Relational/Infrastructure/RelationalModelValidator.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,8 @@ protected virtual void ValidateCompatible(
13931393
storeObject.DisplayName()));
13941394
}
13951395

1396+
var typeMapping = property.GetRelationalTypeMapping();
1397+
var duplicateTypeMapping = duplicateProperty.GetRelationalTypeMapping();
13961398
var currentTypeString = property.GetColumnType(storeObject);
13971399
var previousTypeString = duplicateProperty.GetColumnType(storeObject);
13981400
if (!string.Equals(currentTypeString, previousTypeString, StringComparison.OrdinalIgnoreCase))
@@ -1409,9 +1411,6 @@ protected virtual void ValidateCompatible(
14091411
currentTypeString));
14101412
}
14111413

1412-
var typeMapping = property.GetRelationalTypeMapping();
1413-
var duplicateTypeMapping = duplicateProperty.GetRelationalTypeMapping();
1414-
14151414
Type currentProviderType, previousProviderType;
14161415
if (QuirkEnabled29531)
14171416
{

src/EFCore.Relational/Update/Internal/RowForeignKeyValueFactoryFactory.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ private static IRowForeignKeyValueFactory CreateSimple<TKey, TForeignKey>(
8080
return principalType.IsNullableType()
8181
? (IRowForeignKeyValueFactory<TKey>)Activator.CreateInstance(
8282
typeof(SimpleNullablePrincipalRowForeignKeyValueFactory<,,>).MakeGenericType(
83-
typeof(TKey), typeof(TKey).UnwrapNullableType(), typeof(TForeignKey)), foreignKey, dependentColumn, columnAccessors)!
83+
typeof(TKey), typeof(TKey).UnwrapNullableType(), typeof(TForeignKey)), foreignKey, dependentColumn,
84+
columnAccessors)!
8485
: new SimpleNonNullableRowForeignKeyValueFactory<TKey, TForeignKey>(
85-
foreignKey, dependentColumn, columnAccessors, valueConverterSelector); }
86+
foreignKey, dependentColumn, columnAccessors, valueConverterSelector);
87+
}
8688
else
8789
{
8890
var dependentColumn = foreignKey.Columns.First();
@@ -107,7 +109,8 @@ private static IRowForeignKeyValueFactory CreateSimple<TKey, TForeignKey>(
107109
return principalColumn.IsNullable
108110
? (IRowForeignKeyValueFactory<TKey>)Activator.CreateInstance(
109111
typeof(SimpleNullablePrincipalRowForeignKeyValueFactory<,,>).MakeGenericType(
110-
typeof(TKey), typeof(TKey).UnwrapNullableType(), typeof(TKey), typeof(TForeignKey)), foreignKey, dependentColumn, columnAccessors)!
112+
typeof(TKey), typeof(TKey).UnwrapNullableType(), typeof(TKey), typeof(TForeignKey)), foreignKey, dependentColumn,
113+
columnAccessors)!
111114
: new SimpleNonNullableRowForeignKeyValueFactory<TKey, TForeignKey>(
112115
foreignKey, dependentColumn, columnAccessors, valueConverterSelector);
113116
}

src/EFCore/ChangeTracking/Internal/InternalEntityEntry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public async Task SetEntityStateAsync(
186186
CancellationToken cancellationToken = default)
187187
{
188188
var oldState = _stateData.EntityState;
189-
bool adding;
189+
var adding = false;
190190
await SetupAsync().ConfigureAwait(false);
191191

192192
if ((adding || oldState is EntityState.Detached)

0 commit comments

Comments
 (0)