Check out example codes for "how to add object in dictionary in c#". It will help you in understanding the concepts better.
Code Example 1
public TValue this[TKey key]
{
get
{
int index = this.FindEntry(key);
if (index >= 0)
{
return this.entries[index].value;
}
ThrowHelper.ThrowKeyNotFoundException();
return default(TValue);
}
set
{
this.Insert(key, value, false);
}
}
Code Example 2
// To add an item to a dictionary use 'Add()'
dict.Add(1,"One");
Learn ReactJs, React Native from akashmittal.com