msawczyn / EFDesigner2022

Entity Framework visual design surface and code-first code generation for EF6, Core and beyond
MIT License
122 stars 21 forks source link

ConcurrencyCheck vs Timestamp attribute #20

Closed buchatsky closed 2 years ago

buchatsky commented 2 years ago

Current behaviour "Is Concurrency Token" = true generates [ConcurrencyCheck] attribute for timestamp (RowVersion) field which leaves this field as updatable

Proposed behaviour "Concurrency Type" field instead with 3 values:

Versions EF Visual Editor: 4.1.2.0 Visual Studio 2022: 17.1.3 EntityFrameworkCore: 6.0.3

buchatsky commented 2 years ago

And the connected issue: when "Concurrency Type"=Timestamp, the "Required" attribute should not be added on this field. Otherwise ModelState validation brings an error "RowVersion field is not set" despite it is auto-generated in DB