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