I’m working in a web applications and always i need to use some keys to save some values into object like :
Session[“CurrentUser”] = Users.CurrentUser;
I tried to put them into a resource file but it doesn’t make sense as i will not need to localize them and the code generated by the resource file looks for the culture every time i get a string from the file.
what is the best way to handle those keys in order to avoid spelling mismatches?
I’m using Visual Studio 2010 and ASP.NET MVC2
You could use constants:
and then:
Also the compiler doesn’t care much about spelling or grammar mistakes, as long as the strings match he is OK 🙂