【发布时间】:2010-11-03 10:17:51
【问题描述】:
key为null时如何避免出错?
//Getter/setter
public static Dictionary<string, string> Dictionary
{
get { return Global.dictionary; }
set { Global.dictionary = value; }
}
更新:
Dictionary.Add("Key1", "Text1");
Dictionary["Key2"] <-error! so what can I write in the GET to avoid error?
谢谢。
问候
【问题讨论】:
-
代码不符合问题...你的钥匙在哪里?
标签: c# static-methods