"找不到类型或命名空间名称显示..." "找不到类型或命名空间名称名称..."
public enum MyEnum
{
[Display(Name = "The First")]
first = 1,
[Display(Name = "The Second")]
second,
[Display(Name = "The Third")]
third= 1
}
我试过[DisplayName("The First")]
了,这仅对类、方法属性或事件有效......
我在这里想念什么?
UDPATE:需要[Description()]
所以...
public enum MyEnum
{
[Description("The First")]
first = 1,
[Description("The Second")]
second,
[Description("The Third")]
third= 1
}