Example #1
0
        public override int GetHashCode()
        {
            if (name == null)
            {
                return(0 ^ foodGroup.GetHashCode());
            }

            return(name.GetHashCode() ^ foodGroup.GetHashCode());
        }
Example #2
0
 public override int GetHashCode()
 {
     // Microsoft has already implemented GetHasCode()
     // for standard .NET types
     return(_name.GetHashCode() ^ _group.GetHashCode());
     // ^ is XOR (exclusive OR)
 }
 public override int GetHashCode()
 {
     return(_name.GetHashCode() ^ _group.GetHashCode());
 }
Example #4
0
 public override int GetHashCode() => _name.GetHashCode() ^ _group.GetHashCode();
 public override int GetHashCode()
 {
     return(_name.GetHashCode() ^ _group.GetHashCode());
     //^ - Exclusive OR operator
 }
Example #6
0
 public override int GetHashCode()
 {
     return(_name.GetHashCode() ^ _group.GetHashCode());// GetHashCode already impled for .NET types
 }
Example #7
0
 //Returns a 32-bit hash of the value of the object
 //Hash tables require that if x.Equals(y) then we must have
 //x.GetHashCode() == y.GetHashCode()
 public override int GetHashCode()
 {
     //using exclusive Or operator XOR
     return(name.GetHashCode() ^ group.GetHashCode());
 }
Example #8
0
 public override int GetHashCode()
 // if Equals is overridden, GetHashCod must also be overridden for
 // dictionaries (and anything else that uses hashes) to work properly
 {
     return(_name.GetHashCode() ^ _group.GetHashCode());
 }