I have a Dictionary and every time I call the ContainsKey method it returns false. Take the following example
Boolean found = dict.ContainsKey(new Group("group1", "test"));
The found variable is false eventhough the visual studio debugger shows that a Group with the name "group1" and type "test" is present in dict. What is going on?
My Group class has two String fields (type and name) and I override the Equals method
public override bool Equals(object obj)
{
Group otherGroup = (Group)obj;
return this.name == otherGroup.name && this.type == otherGroup.type;
}