I started coding with contracts in c#. I want to express the following property in c#
ISet<Tuple<A,B>> set;
Contract.Requires(!Contract.Exists(set, (e1,e2) => (((e1 != null) && (e2 != null)) && (e1.Item1 == e2.Item1) && (e1.Item2 != e2.Item2))));
i.e. if the first elements of two tuples are the same the second one should be the same aswell.
The problem here is that (e1,e2) => ... is not a valid expression because of the two arguments. Does anybody now how to express this contract with the both e1 and e2? Or how to rewrite it?