public static SingletonBudgetYearNew SetInstance() { // Uses lazy initialization. // Note: this is not thread safe. _instance = null; return(_instance); }
public static SingletonBudgetYearNew Instance() { // Uses lazy initialization. // Note: this is not thread safe. if (_instance == null) { using (SSLsEntities db = new SSLsEntities()) { _instance = new SingletonBudgetYearNew(); var data = db.BudgetYear.ToList(); _instance.BudgetYear = data; } } return(_instance); }