// No overrides required .. let CLR take care of equal and hashcode.
Class Foo {public Name{get; set;} public Address{get; set;}}
Dictionary<List<Foo>, int> map = new Dictionary<List<Foo>, int>();
Question:
Is this code look alright ? I understand that to be a key in the Map, Foo needs to override equals and hashcode methods – either override both or none.
I was wondering what about List of objects as keys ? What does equality means when it comes to List ? is the map defined above safe from “object-lost-in-the-map” problem ?
-Karephul
1 Answer