nreco / data

Fast DB-independent DAL for .NET Core: abstract queries, SQL commands builder, schema-less data access, POCO mapping (micro-ORM).
https://www.nrecosite.com/dalc_net.aspx
MIT License
183 stars 39 forks source link

Option "None" for attribute "DatabaseGenerated" was ignored #64

Closed s-vitalii closed 3 years ago

s-vitalii commented 3 years ago

NReco.Data doesn't process correctly option "None" for DatabaseGeneratedAttribute. Please check the following code snippet

[Key] [Column("id")] [DatabaseGenerated(DatabaseGeneratedOption.None)] public int Id { get; set; }

This code is valid. However, during INSERT command column {Id} will be skipped because NReco.Data will think that column's value should be generated in DB but not manually. I assume that it checks existing of attribute "DatabaseGenerated" but not "None" option.

VitaliyMF commented 3 years ago

Shipped in 1.2.4