Ejemplo n.º 1
0
 public static SingletonMenu SetInstance()
 {
     // Uses lazy initialization.
     // Note: this is not thread safe.
     _instance = null;
     return(_instance);
 }
Ejemplo n.º 2
0
 public static SingletonMenu Instance()
 {
     // Uses lazy initialization.
     // Note: this is not thread safe.
     if (_instance == null)
     {
         using (SSLsEntities db = new SSLsEntities())
         {
             _instance = new SingletonMenu();
             var data = db.Menu.Where(w => w.Enable == true).ToList();
             _instance.Menu = data;
         }
     }
     return(_instance);
 }