Skip to content

Configuring a custom type mapper for a generated column breaks value generation #11010

@LeroyK

Description

@LeroyK

Version: 2.1.0-preview2-30132

When using a type mapper as described in #242 on a generated column, EF Core seems to use the model type instead of the provider type to check if its value can be generated.

To reproduce, create an entity with a rowversion property and configure a custom type mapper on that property. EF Core will not handle it as a rowversion column after this.

The fix might be changing .ClrType to .GetProviderClrType() in ValueGeneratorConvention.cs, but I have not tested this and I don't know what other implications this might have.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions