Declare a Dictionary inside a static class

后端 未结 9 1234
無奈伤痛
無奈伤痛 2020-12-23 11:11

How to declare a static dictionary object inside a static class? I tried

public static class ErrorCode
{
    public const IDictionary E         


        
9条回答
  •  难免孤独
    2020-12-23 11:24

    OK - so I'm working in ASP 2.x (not my choice...but hey who's bitching?).

    None of the initialize Dictionary examples would work. Then I came across this: http://kozmic.pl/archive/2008/03/13/framework-tips-viii-initializing-dictionaries-and-collections.aspx

    ...which hipped me to the fact that one can't use collections initialization in ASP 2.x.

提交回复
热议问题