Introduction:
Dictionary in C# is a generic collection of Key and Value pair of data, we mainly use dictionary for maintaining a value for a particular,
An example of that would be a phone directory, where we maintain a phone number against a particular entity.
Dictionary in c# comes under a namespace which is System.Collections.Generics and we must have to import this namespace in order to use dictionary in C#.
We can have a dictionary with of two different data types, like we can have different data types for Key and its corresponding value.
Here we will see how we can implement dictionary in C# with carious examples.
So first up creating a new console based application project in Visual Studio 2017.
So, we can declare a dictionary in C# as,
Dictionary<string,string>myDictionary=new Dictionary<string,string>();
So, we are considering an example of creating a dictionary where we are saving employees data with their job designations and occupations.