public bool AreInstancesTheSame() { CakeFactorySingleton cakeFactory1 = CakeFactorySingleton.GetInstance(); CakeFactorySingleton cakeFactory2 = CakeFactorySingleton.GetInstance(); return(cakeFactory1 == cakeFactory2); }
public static CakeFactorySingleton GetInstance() { return(_instance ?? (_instance = new CakeFactorySingleton())); }