public override int GetHashCode()
return _name.GetHashCode() + _address.GetHashCode();
Taking all the variables that may change the state of the object and returning their concatenated hashed values guarantees that each object will have unique values based on state. This allows objects used as keys in collections like hash tables to act in the proper manner.
How to guarantee the GetHashCode() to return the unique value given a state change.
Share this highlighthttp://www.safaribooksonline.com/a/design-patterns/9556/