RIA Services Localization, where to place Resource Files

Posted by kmacmahon on Stack Overflow See other posts from Stack Overflow or by kmacmahon
Published on 2010-03-24T23:07:40Z Indexed on 2010/03/25 0:03 UTC
Read the original article Hit count: 504

I have the following Solution:

  1. SomeProject.Ria (non Silverlight code)
  2. SomeProject.Ria.Silverlight (Silverlight light code, namespace is still SomeProject.Ria)
  3. SomeProject.Ria.MyServices (RIA Services Domain Service)
  4. SomeProject.Ria.MyServices.Proxies (RIA Services Silverlight Generated Code)
  5. SomeProject.Shell (Silverlight Applicaiton)
  6. SomeProject.Web (Web Application)

I would like to use Resource Files for my Annotations on the meta data class in SomeProject.Ria.MyServices.

The format for that appears to be:

[Required(AllowEmptyStrings=false,ErrorMessageResourceName="ThisFieldIsRequired", ErrorMessageResourceType(MyResource))]     

Which project does MyResource belong in? (Assuming that someday I need to support other culture files).

Also the use of the string in here really seems to breed room for error, is it possible to do something like this and still achieve localization, or does this just get compiled into the meta data? If not, how can I get round the resource name being a string?

[Required(AllowEmptyStrings=false,ErrorMessage=MyResources.RequiredMessage)]            

© Stack Overflow or respective owner

Related posts about wcf-ria-services

Related posts about silverlight-4.0