C# Class that Returns Dictionary with a Custom Object & Multiple Strings Pair -


i'm looking create class returns constructed dictionary. i'm uncertain how code constructor return dictionary, how initialize multiple string values pair key, , examples i've found rough drafts. here's rough example:

namespace myapp.helpers {     public enum housesize     {         big,         medium,         small     }     class houses     {         public static dictionary<housesize, string> _dictionaryofhouses;          public static dictionary<housesize, string> houses         {                         {                 if (_dictionaryofhouses == null)                     loadhouses();                 return _dictionaryofhouses;             }         }     }     private static void loadhouses()     {         _dictionaryofhouses = new dictionary<housesize, string>;         _dictionaryofhouses.add(housesize.big, /*add string properties here red, 2 floor, built in 1975*/);         _dictionaryofhouses.add(housesize.small, /*add string properties here blue, 1 floor, built in 1980*/);     } } 

you use list<string> rather simple string. or perhaps class holds properties such as:

class houseproperties {     public string color { get; set; }     public string yearbuilt { get; set; }  // assume having these strings more     public string numfloors { get; set; }  // helpful storing number } 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -