Skip to content

DB-first generation leads to incorrect DeleteBehavior mapping #508

Description

@teejay-87

All my relations have ON DELETE set to RESTRICT.

When generating code with a DB-first approach using:

dotnet ef dbcontext scaffold "<connstring>" Npgsql.EntityFrameworkCore.PostgreSQL

in Context.cs I get:

entity.HasOne(d => d.ContactPerson) .WithMany(p => p.Registrations) .HasForeignKey(d => d.ContactPersonId) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("contact_persons_fkey");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions