Dictionary<tkey,tvalue>
Tkey
can be any
Type
say { string , int etc.... }
TValue
can be of any
Type
say { object , datatable etc.... }
Example:
Dictionary<string,int> dictionary;
This dictionary can store unique
keys
of type string and any integer
values
.
Sample:
public Dictionary<string, int> PrintConsole()
{
Dictionary<string, int> dic = new Dictionary<string, int>();
dic.Add("one", 1);
dic.Add("two", 2);
dic.Add("three", 3);
return dic;
}