Remember that this might lead to other effects! You should override GetHashCode and implement other equality members in order to make the comparison consistent. But for implementing that the right way, you should think about what really means “equal” in your case.