Setting the default value of a C# Optional Parameter -


whenever attempt set default value of optional parameter in resource file, compile-time error of

default parameter value 'message' must compile-time constant.

is there way can change how resource files work make possible?

public void validationerror(string fieldname,                              string message = validationmessages.contactnotfound) 

in this, validationmessages resource file.

no, not able make resource work directly in default. need set default value null , resource lookup when parameter has default value in body of method.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -