Dictionary<,>
doesn't itself override Equals
and GetHashCode
- so your Trigger
implementations are broken. You would need to work out what equality you wanted and implement it yourself.
I have a sample implementation in protobuf-csharp-port which you might want to look at.
EDIT: Your change still isn't quite right. You should implement equality like this:
return Event.Equals(item.Event) &&
Dictionaries.Equals(Parameters, item.Parameters);
and implement GetHashCode
as:
var hash = 17;
hash = hash * 23 + Dictionaries.GetHashCode(Parameters);
hash = hash * 23 + Event.GetHashCode();
return hash;