Example #1
0
        public override int GetHashCode()
        {
            int hash1 = Field1.GetHashCode();
            int hash2 = Field2.GetHashCode();

            // https://en.wikipedia.org/wiki/Pairing_function
            return(((hash1 + hash2) * (hash1 + hash2 + 1) / 2) + Math.Min(hash1, hash2));
        }
Example #2
0
            public override int GetHashCode()
            {
                int result = string.IsNullOrEmpty(Field1) ? 0 : Field1.GetHashCode() + Field2.GetHashCode();

                return(result);
            }