コード例 #1
0
 public static SingletonPayment SetInstance()
 {
     // Uses lazy initialization.
     // Note: this is not thread safe.
     _instance = null;
     return(_instance);
 }
コード例 #2
0
 public static SingletonPayment Instance()
 {
     // Uses lazy initialization.
     // Note: this is not thread safe.
     if (_instance == null)
     {
         using (SSLsEntities db = new SSLsEntities())
         {
             _instance = new SingletonPayment();
             var data = db.PaymentType.Where(w => w.Enable == true).OrderBy(w => w.Id).ToList();
             _instance.PaymentTypes = data;
         }
     }
     return(_instance);
 }