Dictionary fruit<string,string> = new Dictionary<string,string>();
fruit.Add("name","orange");
fruit.Add("vitamin","C");
I want call value with key. But, if i am write fruit.Key, c# is giving "name" what is problem?
Dictionary fruit<string,string> = new Dictionary<string,string>();
fruit.Add("name","orange");
fruit.Add("vitamin","C");
I want call value with key. But, if i am write fruit.Key, c# is giving "name" what is problem?
Both will work:
string name = fruit["name"];
or:
string vit = fruit.Single(c => c.Key == "vitamin").Value;
Problem is here (from my worktable) :
WhatisMethodForGetValue() {
//????????????????????????????
}
var tas = new Dictionary<string, string>();
string sayi;
string renk;
bool okey = false;
tas["sayi"] = seriler[j];
tas["renk"] = renkler[i];
tas["okey"] = okey.ToString();
foreach (KeyValuePair<string, string> mytas in (dynamic)TAS[v])
{
Button Tas = new Button();
Tas.BackColor = Color.White;
Tas.Text = WhatisMethodForGetValue(mytas["sayi"]);
}