string thing = ComparaSave.Resources.Message.EmailAdrRequired;
[Required(ErrorMessage = thing)] <---- The problem!!
[DataType(DataType.EmailAddress)]
[Display(Name = "Email Address")]
[StringLength(100)]
[EmailAddress]
public string Email { get; set; }
抛出错误:
属性参数必须是属性参数类型的常量表达式、typeof 表达式或数组创建表达式。
如何将资源文件读入这样的属性?