public override int GetHashCode()
 {
     unchecked
     {
         return((SomeString != null ? SomeString.GetHashCode() : 0) ^ SomeInteger.GetHashCode());
     }
 }
Beispiel #2
0
        public bool Equals(Entity other)
        {
            //Check whether the compared object is null.
            if (Object.ReferenceEquals(other, null))
            {
                return(false);
            }

            //Check whether the compared object references the same data.
            if (Object.ReferenceEquals(this, other))
            {
                return(true);
            }

            //Check whether the products' SomeString and SomeInt properties are equal.
            return(SomeString.Equals(other.SomeString) && SomeInt.Equals(other.SomeInt));
        }