I am trying to the following thing:
[Display(Name = Resources.LcmsBs.Models.UserName)]
[ToolTip(Resources.LcmsBs.ToolTips.UserName)]
public string UserName { get; set; }
I am getting the following compilation error :
An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type
What is the best practice to avoid hard coded constants in code ?
Is it possible to set attributes values from the resources ?
You’ve got a slightly different question but the answer to the following could be applied to your question
DataAnnotations and Resources don't play nicely
Something like the following