Function returning dictionary, not seen by calling function
- by twiga
Hi There,
I have an interesting problem, which is a function that returns a Dictionary<String,HashSet<String>>.
The function converts some primitive structs to a Dictionary Class.
The function is called as follows:
Dictionary<String, HashSet<String>> Myset = new Dictionary<String,HashSet<String>>();
Myset = CacheConverter.MakeDictionary(_myList);
Upon execution of the two lines above, Myset is non-existent to the debugger. Adding a watch results in:
"The name 'Myset' does not exist in
the current context"
public Dictionary<String, HashSet<String>> MakeDictionary(LightWeightFetchListCollection _FetchList)
{
Dictionary<String, HashSet<String>> _temp = new Dictionary<String, HashSet<String>>();
// populate the Dictionary
// return
return _temp;
}
The Dictionary _temp is correctly populated by the called function and _temp contains all the expected values.
The problem seems to be with the dictionary not being returned at all.
Examples I could find on the web of functions returning primitive Dictionary<string,string> work as expected.