Ejemplo n.º 1
0
        public static CitySingleton GetInstance()
        {
            if (singleton == null)
            {
                singleton = new CitySingleton();
            }

            return(singleton);
        }
Ejemplo n.º 2
0
        internal static void ReadAllCities()
        {
            List <City> cities = CitySingleton.GetInstance().Cities;

            cities.ForEach(city => Console.WriteLine(city));
        }