Dictionary<TKey, TValue>

noun

say it: “DIK-shun-air-ee” /ˈdɪkʃənɛri/

A C# collection that stores values under unique keys, so you can look each value up by its key.

What is Dictionary<TKey, TValue> in C#?

Dictionary<TKey, TValue> — A collection that associates unique keys with values.

class Inventory
{
    Dictionary<string, int> stock = new();
}

In a sentence

  • “I keep stock counts in a Dictionary<string, int>, keyed by title.”

Level: Freelancer · More C# terms at this level

Updated