Example #1
0
 public static SingletonShareMonth SetInstance()
 {
     // Uses lazy initialization.
     // Note: this is not thread safe.
     _instance = null;
     return(_instance);
 }
Example #2
0
 public static SingletonShareMonth Instance()
 {
     // Uses lazy initialization.
     // Note: this is not thread safe.
     if (_instance == null)
     {
         using (SSLsEntities db = new SSLsEntities())
         {
             _instance = new SingletonShareMonth();
             var data = db.ShareMonth.ToList();
             _instance.ShareMonth = data;
         }
     }
     return(_instance);
 }