May 09, 2012 01:00 PM|lax4u|LINK
I’m validating my WCF request object’s parameter using DataAnnotation. This is working fine and no problems there.
I want to store my error messages into resx file. According to my understanding the default resource provider will use the Current thread’s UI culture to determine which resource string to retrieve.
Do I need to name the .resx file in certain way so that resource provider will know which file to use for particular culture? If yes, what is the naming convention?
For example, if you see the code below ErrorMessageResourceType is set to ServiceResourceStrings which is the class created by .Net for .resx file, now if I have one more .resx file for different language say “es-MX”, then it will have different class name.
I don’t see the .resx file itself stored any culture code
[Required(ErrorMessageResourceName = "NameRequired", ErrorMessageResourceType = typeof(ServiceResourceStrings))]
public string Name