public static SingletonDebtor SetInstance() { // Uses lazy initialization. // Note: this is not thread safe. _instance = null; return(_instance); }
public static SingletonDebtor Instance() { // Uses lazy initialization. // Note: this is not thread safe. if (_instance == null) { using (SSLsEntities db = new SSLsEntities()) { _instance = new SingletonDebtor(); var data = db.Debtor.Where(w => w.Enable == true).OrderBy(w => w.Id).ToList(); _instance.Debtors = data; } } return(_instance); }