static void Main(string[] args) { MyDictionary<string, Auto> auto = new MyDictionary<string, Auto>(); Auto car = new Auto(); auto.Add("Car", car); auto["Car"].Name = "Audi"; Console.WriteLine(auto["Car"].Name); Console.WriteLine(); Console.ReadLine(); }
static void Main(string[] args) { MyDictionary<string, Auto> auto = new MyDictionary<string, Auto>(); Auto car = new Auto(); auto.Add("Audi", car); auto.Add("BMW", car); foreach (var s in auto) { Console.WriteLine(s.Key); } Console.WriteLine(); Console.ReadLine(); }