【发布时间】:2014-12-03 06:54:49
【问题描述】:
我在 VS-2013 工作。我添加了 ADO.NET Entity Data Model 包含:
- 来自数据库的 EF 设计器,
- 数据库中的代码优先
连接到我数据库中的一些表,它生成了带有部分类的tt文件,并在表的每个字段上添加注释如下:
ms_item_cat.cs
public partial class ms_item_cat
{
public ms_item_cat()
{
ms_items = new HashSet<ms_items>();
}
[Key]
public int pk_icat_id { get; set; }
[Required]
[StringLength(50)]
public string icat_name { get; set; }
[StringLength(50)]
public string icat_image_path { get; set; }
}
它没有显示我添加到表中的一些扩展属性,例如说明等
下面的脚本是显示那些扩展属性:
select p.*, t.*
from sys.extended_properties p
inner join sys.tables t on p.major_id = t.object_id
where class = 1
【问题讨论】:
-
您是否想在对象中看到这些扩展属性?
-
是的,我想在
model.ttT4 模板文件中显示SQL 表的扩展 属性。
标签: c# sql-server-2008 entity-framework-6 t4 edmx