Skip to content

Disable identity column generation for the entire model #3723

@nandor23

Description

@nandor23

Currently, there are methods to configure identity generation strategy globally (e.g. UseIdentityColumns(), UseIdentityAlwaysColumns()), which control whether the database generates values automatically or allows user-provided values. However, there's no way to disable database generation entirely and require that all identity values must be provided by the application.

It would be helpful to have a method like:

protected override void OnModelCreating(ModelBuilder modelBuilder)
    => modelBuilder.UseNoIdentityGeneration();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions