public static GodObject GetInstance() { if (_instance == null) { _instance = new GodObject(); } return(_instance); }
public override void ExecuteSample() { base.ExecuteSample(); var objectA = GodObject.GetInstance(); var objectB = GodObject.GetInstance(); Console.WriteLine($"Objects are equal: {objectA.Equals(objectB)}"); Console.WriteLine($"Objects are equal: {Object.ReferenceEquals(objectA, objectB)}"); }