SQL Server UseIdentityColumn() (and others) are incompatible with value generation #33413
Labels
area-model-building
area-sqlserver
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
Milestone
Try to call UseIdentityColumn() on a property that has a value converter configured fails with: "Identity value generation cannot be used for the property 'Id' on entity type 'Blog' because the property type is 'BlogId'. Identity value generation can only be used with signed integer properties."
Removing the explicit UseIdentityColumn() (but leaving ValueGeneratedOnAdd()) succeeds, creating an identity column as expected - it seems like our check for UseIdentityColumn() compatibility (and other similar value generation strategies) is too strict.
On a related note, leaving out ValueGeneratedOnAdd() doesn't create an identity column at all, although my expectation here is for that to happen, as the property is still called Id and has a provider type of int (but my expectation here may be wrong).
Originally opened by @grzegorzkarolewski against PostgreSQL in npgsql/efcore.pg#3141.
Repro
,/details>
The text was updated successfully, but these errors were encountered: