2
鉴于类:置换[显示]属性
public class Item
{
[Key]
public int ID { get; set; }
[Display]
public string Name { get; set; }
public string Observation { get; set; }
public DateTime? Done { get; set; }
}
我知道我可以定义我的[关键]属性,并通过在另一个项目中创建一个映射类和EntityTypeConfiguration继承其他映射设置。
但我怎么可以替换[display]属性,所以我不必添加到我的通用DLL的System.ComponentModel.DataAnnotations引用?
告诉我,如果我不够清晰
引用DataAnnotations没有任何问题。 – SLaks
[以编程方式添加数据注释]的可能重复(http://stackoverflow.com/questions/8394564/add-data-annotations-programmatically) –