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