Skip to content

Commit ba5a75d

Browse files
committed
Fix using wrong entity type object to get schema name
1 parent 7b1c263 commit ba5a75d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/EntityFrameworkCore.Scaffolding.Handlebars/HbsCSharpDbContextGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ private void GenerateRelationship(IForeignKey foreignKey, bool useDataAnnotation
714714

715715
lines.Add(
716716
$".{nameof(ReferenceReferenceBuilder.HasForeignKey)}"
717-
+ (foreignKey.IsUnique ? $"<{GetEntityTypeName(foreignKey.PrincipalEntityType, EntityTypeTransformationService.TransformTypeEntityName(((ITypeBase)foreignKey.DeclaringEntityType).DisplayName()))}>" : "")
717+
+ (foreignKey.IsUnique ? $"<{GetEntityTypeName(foreignKey.DeclaringEntityType, EntityTypeTransformationService.TransformTypeEntityName(((ITypeBase)foreignKey.DeclaringEntityType).DisplayName()))}>" : "")
718718
+ $"(d => {GenerateLambdaToKey(foreignKey.Properties, "d", EntityTypeTransformationService.TransformPropertyName)})");
719719

720720
var defaultOnDeleteAction = foreignKey.IsRequired

0 commit comments

Comments
 (0)