Example #1
0
 public static SingletonAgeOfShare SetInstance()
 {
     // Uses lazy initialization.
     // Note: this is not thread safe.
     _instance = null;
     return(_instance);
 }
Example #2
0
 public static SingletonAgeOfShare Instance()
 {
     // Uses lazy initialization.
     // Note: this is not thread safe.
     if (_instance == null)
     {
         using (SSLsEntities db = new SSLsEntities())
         {
             int thisBudget = SingletonThisBudgetYear.Instance().ThisYear.Id;
             _instance = new SingletonAgeOfShare();
             var data = db.AgeOfShare.Where(w => w.Enable == true)
                        .OrderBy(w => w.TermStart).ToList();
             _instance.AgeOfShare = data;
         }
     }
     return(_instance);
 }