I have a dictionary defined as:
Dictionary<string, string> typeLookup = new Dictionary<string, string>();
I want to add a key/value to the dictionary based on what language the user has selected, which in my case is found with:
Request.Cookies["language"].Value == "ja-JP" //if true, Japanese, if false, English
I could just do if/elses, but I'm curious if there is some way to make this work:
typeLookup.Add((Request.Cookies["language"].Value == "ja-JP") ? "6","中間" : "6","Q2");
As it's a Dictionary, two strings need to be specified. This doesn't work, giving me "Syntax error, ':' expected". Is this a lost cause, or is there something I need to change/add to make this idea work?