Fix EFCore obsoletion warnings in Content.Server.Database (#26285)

This commit is contained in:
Pieter-Jan Briers
2024-03-20 15:47:36 +01:00
committed by GitHub
parent 205edfe6d7
commit fc76996dc5

View File

@@ -301,14 +301,14 @@ namespace Content.Server.Database
private static void RewriteColumnName(IConventionPropertyBuilder propertyBuilder)
{
var property = propertyBuilder.Metadata;
var entityType = property.DeclaringEntityType;
var entityType = (IConventionEntityType)property.DeclaringType;
if (entityType.ClrType == typeof(Microsoft.EntityFrameworkCore.Migrations.HistoryRow))
return;
property.Builder.HasNoAnnotation(RelationalAnnotationNames.ColumnName);
var baseColumnName = StoreObjectIdentifier.Create(property.DeclaringEntityType, StoreObjectType.Table) is { } tableIdentifier
var baseColumnName = StoreObjectIdentifier.Create(entityType, StoreObjectType.Table) is { } tableIdentifier
? property.GetDefaultColumnName(tableIdentifier)
: property.GetDefaultColumnName();