From 9903710117e9bac4ca4b552246aa2ef89316106a Mon Sep 17 00:00:00 2001 From: Brian Tyler Date: Tue, 29 Aug 2023 16:47:03 +0100 Subject: [PATCH] fix: allow library to build with dotnet 8 preview 7 --- EFCore.NamingConventions/Internal/NameRewritingConvention.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EFCore.NamingConventions/Internal/NameRewritingConvention.cs b/EFCore.NamingConventions/Internal/NameRewritingConvention.cs index 84ce142..361a175 100644 --- a/EFCore.NamingConventions/Internal/NameRewritingConvention.cs +++ b/EFCore.NamingConventions/Internal/NameRewritingConvention.cs @@ -293,14 +293,14 @@ public void ProcessModelFinalizing(IConventionModelBuilder modelBuilder, IConven private void RewriteColumnName(IConventionPropertyBuilder propertyBuilder) { var property = propertyBuilder.Metadata; - var entityType = property.DeclaringEntityType; + var entityType = (IConventionEntityType)property.DeclaringType; // Remove any previous setting of the column name we may have done, so we can get the default recalculated below. property.Builder.HasNoAnnotation(RelationalAnnotationNames.ColumnName); // TODO: The following is a temporary hack. We should probably just always set the relational override below, // but https://github.com/dotnet/efcore/pull/23834 - var baseColumnName = StoreObjectIdentifier.Create(property.DeclaringEntityType, StoreObjectType.Table) is { } tableIdentifier + var baseColumnName = StoreObjectIdentifier.Create(entityType, StoreObjectType.Table) is { } tableIdentifier ? property.GetDefaultColumnName(tableIdentifier) : property.GetDefaultColumnName(); if (baseColumnName is not null)