how to read the validation message from resource file

how to read the validation message from resource file

Old forum URL: forums.lhotka.net/forums/t/10157.aspx


wasiuddin.786 posted on Thursday, March 10, 2011

how to read the validation message from resource file

i have two two project fro business model

 

1)Model.Client

2)Model.Server

 

so how to add the resource file to server and how to add the link to client side

please give me steps so i can read the validation massage from resource file

 

it will should work client and serverside validation

 

mosgath replied on Friday, March 11, 2011

We use a resource file called RulesMessages under a resources folder in our server model project and then add it as a linked file in the client Model project. 

Then in the business rules we use the following to access it in the business rule.

var message = string.Format(Resources.RulesMessages.SomeMessage, PrimaryProperty.FriendlyName);
context.AddInformationResult(PrimaryProperty, message);

Copyright (c) Marimer LLC