dotnet / efcore

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
https://docs.microsoft.com/ef/
MIT License
13.8k stars 3.19k forks source link

DatabaseGeneratedAttribute in scaffolded code #22170

Open smitpatel opened 4 years ago

smitpatel commented 4 years ago

Currently we don't generate that attribute at all.

Split off from #22122

bricelam commented 4 years ago

You say that like it's a bad thing... 😏

ajcvickers commented 4 years ago

@bricelam Was this by-design?

smitpatel commented 4 years ago

If it was a bad thing then it would have been a 🐛

bricelam commented 4 years ago

I don’t know. I remember the mismatch between its enum and ours came up in the past. But I don’t remember deciding to never do it.

ajcvickers commented 4 years ago

Note from triage: we should scaffold this when data annotations are being used and the property does not match the convention. Yes, the naming is bad, but it is what it is now.