> For the complete documentation index, see [llms.txt](https://cnahmet.gitbook.io/asp-net-notlarim/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cnahmet.gitbook.io/asp-net-notlarim/collections/dictionary-less-than-tkey-tvalue-greater-than.md).

# Dictionary\<TKey,TValue>

## Dictionary Oluşturma

```
           Dictionary<int,string> plakalar = new Dictionary<int, string>();

           plakalar.Add(38,"Kayseri");
           plakalar.Add(06,"Kayseri");

           Dictionary<int,string> sayilar = new Dictionary<int, string>
           {
               {1,"Bir"},
               {2,"İki"},
               {3,"Üç"},
               {4,"Dört"},
               {5,"Beş"},
           };
```

## Dictionary elemanlarına erişip yazdırma

```
            Console.WriteLine(sayilar[1]);

            foreach(var p in plakalar){
                Console.WriteLine($"{p.Key} - {p.Value}");
            }

            for(int i=0; i<sayilar.Count;i++){ 
                Console.WriteLine($"{sayilar.Keys.ElementAt(i)} - {sayilar.Values.ElementAt(i)}");
            }

            if(plakalar.ContainsKey(34)){
                Console.WriteLine("Plaka bu ilde kullanılabilir");
            }else{
                Console.WriteLine("Plaka bu ilde kullanılamaz");
            }

            if(sayilar.Contains(new KeyValuePair<int,string>(5,"Beş"))){
                Console.WriteLine("Bu sayı 5");
            }else{
                Console.WriteLine("Böyle bir sayı tanımlanmamış");
            }
```
