public static ClasseSingleton Instance() { if (_instance == null) { _instance = new ClasseSingleton(); } return(_instance); }
static void ImplementacaoBasica() { var instance = ClasseSingleton.Instance(); Console.WriteLine($"Primeira chamada: {instance.Id}"); var instance2 = ClasseSingleton.Instance(); Console.WriteLine($"Segunda chamada: {instance2.Id}"); }