静的クラス内で静的辞書オブジェクトを宣言する方法は? 私は試した
public static class ErrorCode
{
public const IDictionary<string, string> ErrorCodeDic = new Dictionary<string, string>()
{
{ "1", "User name or password problem" }
};
}
しかし、コンパイラは「文字列以外の参照型の const フィールドは null でしか初期化できない」と文句を言います。