C# Dictionary
C# Dictionary kullanımına bir örnek;
private static readonly Dictionary<string, string> _changedResources = new Dictionary<string, string>;
{
{ "400002", "Olay" },
{ "400003", "Problem" },
{ "400004", "Talep" },
{ "400005", "Proje Geçişi" },
{ "400006", "Diğer" },
{ "400007", "Küçük İstek" },
{ "400008", "Proje Sonrası Düzeltme" },
{ "400009", "İyileştirme" },
{ "400010", "Proje Sonrası Düzeltme" },
{ "400012", "Projeye Bağlı Diğer Değişiklik" }
};
internal static string GetChangeResourceType(int changeOrderId)
{
ChngTbl c = new ChngTbl();
Query q = new Query();
q.
Select(c.ChangeResourceType).
From(c).
Where(c.ChangeOrderId == changeOrderId.ToString(CultureInfo.InvariantCulture));
string changeResourceTypeId = new CIntDac().ExecuteScalar(q).ToString();
if (_changedResources.ContainsKey(changeResourceTypeId))
return _changedResources[changeResourceTypeId];
return string.Empty;
}

Yorumlar
Yorum Gönder