Skip to content

Commit

Permalink
fix: allow library to build with dotnet 8 preview 7
Browse files Browse the repository at this point in the history
  • Loading branch information
hackf5 authored and bricelam committed Nov 3, 2023
1 parent 618ce09 commit 9903710
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions EFCore.NamingConventions/Internal/NameRewritingConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9903710

Please sign in to comment.