I've read the docs, browsed the source and applied my Google and Bing Foo but can not determine
How to set the description on a SQL column using EF Core Code First.
Help!
There is no native API to do it. You would need to use the Sql(string) method in a migration to set the description.
Is there any plans to implement this? My boss just mandated that we start applying a description to every column we create from now on, and we are heavily using EF Core. I'd much rather be able to use Data Annotations to generate these than manual Sql(string) calls.
@NArnott This is being tracked by #15037. It is likely also possible to flow your own annotations through to Migrations, but it's not super easy to do right now--see #10258.
modelBuilder.Entity
.Property(e => e.MyProperty)
.HasComment("My Column Description");
Most helpful comment
modelBuilder.Entity()
.Property(e => e.MyProperty)
.HasComment("My Column Description");