![](/img/trans.png)
[英]How to add description to columns in Entity Framework 4.3 code first using migrations?
[英]How to add description to columns in Entity Framework Core code-first using migrations?
我正在使用 Entity Framework Core 3.0 代码。 如何为实体配置类或迁移中的列添加描述,以便它们最终作为 SQL Server 中的列描述?
Entity Framework 4.3.1 有一个出版物,但我无法在 Entity Framework Core 中做到这一点。
您可以使用HasComment fluent API:
modelBuilder.Entity<MyEntity>()
.Property(e => e.MyProperty)
.HasComment("My Column Description");
对于 SqlServer,这映射到相应的表列描述。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.