Understanding C# property syntax and getters/setters -


i coming on java world , construct driving me nuts:

    private static string _muiurl;      private static string muiurl     {                 {             if (string.isnullorempty(_muiurl))             {                 using (var db = new intlmpdb())                 {                     _muiurl =                         (from c in db.control c.controlkey == "mui_url" select c.controlvalue).firstordefault();                 }             }             return _muiurl;         }     } 

when see in class , want use property in class itself, how should call it?

simply follows:

var result = typewithmuiurlproperty.muiurl; 

you can omit class name mentioned others, however, explicitness leave in example.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -