From 25e1dd471555b0e619fa1779d3fe64759cf59441 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Wed, 20 Mar 2024 15:47:36 +0100 Subject: [PATCH] Fix EFCore obsoletion warnings in Content.Server.Database (#26285) --- Content.Server.Database/SnakeCaseNaming.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Server.Database/SnakeCaseNaming.cs b/Content.Server.Database/SnakeCaseNaming.cs index ca1a9665848..27ce392cd50 100644 --- a/Content.Server.Database/SnakeCaseNaming.cs +++ b/Content.Server.Database/SnakeCaseNaming.cs @@ -301,14 +301,14 @@ public void ProcessModelFinalizing(IConventionModelBuilder modelBuilder, IConven 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();