Is there a way to set a DLL to always follow CultureInfo.InvariantCulture by default, if not specifi
- by JL
I have a lot of code in a class library that does not specify CultureInfo.InvariantCulture. For example in toString operations, toBool, toInt, etc.
Is there a way I can get set a property for the class library to always execute using CultureInfo.InvariantCulture, even if it is not explicitly specified everywhere in the code?
Sort of like a global switch?
It is not only messy to have to explicitly type it everytime, it makes my code less readable, and is a royal pain for example:
if (Convert.ToInt16(task.RetryCount, CultureInfo.InvariantCulture) <
Convert.ToInt16(ConfigurationManager.AppSettings["TasksMaxRetry"], CultureInfo.InvariantCulture))