I am creating a profile page wizard so the user would have quite a few select boxes to validate against.
The way I have it set up the value of my select boxes are keys to an string array.
For example:
string[] HairColor = {"blonde", "amber", "black", "platinum"}.
Would there be a threading issue if I create a helper static class, and uses a method such as:
public static string GetHairColor(int key)
{
string[] HairColor = {"blonde", "amber", "black", "platinum"}.
return HairColor[key];
}
The reason why I want to return a string, is because I would rather limit the amount I would have to validate against, if the number returns a value then, I call a db or cache save. So instead of the user inserting there string values, I am inserting it for them based on the number they pass in.
My question is if users were concurrently checking against this method, would there be an issue with threading?
*note I am not passing the array into the view, I am just trying to quickly check the user isn't passing in a number that doesn't exist, if it does grab it and persist it. Thanks for your help everyone.