Hello .
I use [DisplayName("")] to change JobNameand it workes fine but I tried to Read Job Name from Resource file and for this I have to use [Display(name"",ResourceType=typeof())] but in this case it doesnt work .
I wonderd to know does it support[Diplay] attribute
No, it doesn't. Would be supported if PR #993 is merged.
thank you . but My boss give me an idea .
create a custome Attribute Like below :
public class LocalizedDisplayNameAttribute : DisplayNameAttribute
{
public LocalizedDisplayNameAttribute( string resourceId)
: base(GetMessageFromResource(resourceId))
{ }
private static string GetMessageFromResource(string resourceId)
{
// TODO: Return the string from the resource file
}
} `
then we need to use this attribute instead DisplayName .
Most of the attributes inside .NET BCL are sealed, so you cannot inherit from them. For example, DisplayAttribute you mentioned above is sealed.
But you're lucky, as DisplayNameAttribute is not. Not only that, its DisplayName property is virtual, so you can override it in the derived class.