C# Dictionary

A Dictionary is a public class we can use to represent a collection of keys and values.

It’s a collection of KeyValuePairs.

It’a generic type:


that resides in the System.Collections.Generic:

namespace System.Collections.Generic

Normally Collections that aren’t generic do reside in the System.Collections while generic ones reside in the System.Collections.Generic namespace.

Both of these assemblies reside in the mscorlib.dll assembly.

A Dictionary can actually be serialized. Serialiazation is the process of the converting in memory objects into a bytestream.

That stream can then saved or even sent over the network then deserialized back into memory as an object again.


Share an Example

Share an Example

What is the capital of Egypt? ( Cairo )