c# create a dictionary code example
Example 1: c# initialize dictionary
Dictionary<int, string> dictNew = new Dictionary<int,string>()
{
{1, "true"},
{2, "false"}
}
Example 2: c sharp add item to dictionary
// To add an item to a dictionary use 'Add()'
dict.Add(1,"One");