Dictionary sınıfı eklendiği elemanları key ve value olarak kaydetmemize yarayan bir sınıfdır.

Bu sınıfın özelliğini kullanabilmemiz için System.Collections.Generic kütüphanesini ilk önce eklememiz lazım.

Unutmadan eğer key  değerine göre otomatik sıralı bir liste oluşturmak istersek SortedList kullanmak daha iyi olur.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dictionary
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<int, string> Personeller = new Dictionary<int, string>();
            Personeller.Add(0, "Harun Demir");
            Personeller.Add(1, "Kazım ÖNCÜ");
            Personeller.Add(2, "Mustafa Bayram");
            Personeller.Add(3, "Fikret ALTINOK");
            Personeller.Add(4, "Derya HANCI");
            Personeller.Add(5, "Enes MUTLU");
            Personeller.Add(6, "Yağmur KOCABEY");
            Personeller.Add(7, "Nergiz ÇELİK");

            foreach (KeyValuePair<int, string> Calisan in Personeller)
            {
                Console.WriteLine("ID =>" + Calisan.Key + "\t" + "Ad Soyad =>" + Calisan.Value);
            }
            Console.ReadLine();
        }
    }
}