msawczyn / EFDesigner2022

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

"Db Default Value" property for entity fields #15

Closed buchatsky closed 2 years ago

buchatsky commented 2 years ago

Proposed behaiour "Db Default Value" (or whatever) property in "Database" category for entity fields which would generate .HasDefaultValueSql(string) clause in DbContext.OnModelCreating() method. E.g. "(getdate())", "(newid())" or user-defined functions. User scenarios:

Current behaviour Allows only initial values of the same type as field type. Doesn't allow string expressions.

Versions EF Visual Editor: 4.1.2.0 Visual Studio 2022: 17.1.3