I have a dictionary pair
i make an object of dictionary “paramList”, now i have added key and value pair to that object, now i want to know if on the some other page i pass the object paramList in some method and on that page i know the key and i want to access it’s corresponding value then how can i do that
I have object like this
Dictionary<string, object> paramList = new Dictionary<string, object>();
paramList.Add("@courseId", course_id);
paramList.Add("@passoutYear", passoutYear);
paramList.Add("@currentBacklog", currentBacklog);
paramList.Add("@sex", sex);
now if i know the key @key and want to know it’s corresponding value i also have the object
If I understand your question correctly, you want to know if the key exists in the dictionary and then retrieve the value.
Perhaps the simplest way is using TryGetValue