.NET Dictionary as a Property

后端 未结 8 612
-上瘾入骨i
-上瘾入骨i 2021-02-02 08:30

Can someone point me out to some C# code examples or provide some code, where a Dictionary has been used as a property for a Class.

The examples I have seen so far don\'

8条回答
  •  误落风尘
    2021-02-02 09:09

    Another example of using a dictionary as a static property with only the get accessor:

      private static Dictionary  dict = new  Dictionary   (){            
                {"Design Matrix", "Design Case"},
                {"N/A", "Other"}
        };
    
    
        public static Dictionary  Dict
        {
            get { return dict}
        }          
    

    This structure can be used to replace values.

提交回复
热议问题