Check out example codes for "c sharp create dictionary". It will help you in understanding the concepts better.

Code Example 1

// To initialize a dictionary, see below:
IDictionary<int, string> dict = new Dictionary<int, string>();
// Make sure to give it the right type of key and value

// To add values use 'Add()'
dict.Add(1,"One");
dict.Add(2,"Two");
dict.Add(3,"Three");

// You can also do this together with the creation
IDictionary<int, string> dict = new Dictionary<int, string>()
{
	{1,"One"},
	{2, "Two"},
	{3,"Three"}
};

Code Example 2

var testDict = new Dictionary<string, string>() { ["key1"] = "value1", ["key2"] = "value2" };

Learn ReactJs, React Native from akashmittal.com