我有一个视图模型,我想从资源位置指定标签。我可以这样做:
class X {
[Display(Name = "First", Resource = typeof(i18n.X))]
public string FirstName { get; set; }
[Display(Name = "Last", Resource = typeof(i18n.X))]
public string LastName { get; set; }
}
但有没有办法做这样的事情?
[Display(Resource = typeof(i18n.X))]
class X {
[Display(Name = "First")]
public string FirstName { get; set; }
[Display(Name = "Last")]
public string LastName { get; set; }
}