i have a class whose equality is based on 2 fields such that if either one is equal then the objects of this type are considered equal. how can i write a hashCode() function for
How about this
public override int GetHashCode() { return (id.ToString() + name.ToString()).GetHashCode(); }
The function should allways return a "valid" hash...
Edit: just noticed that you use "or" not "and" :P well i doubt there is any good solution to this problem...