コード例 #1
0
        public override int GetHashCode()
        {
            int result = 7;

            result = 7 * result + Related.GetHashCode();
            result = 7 * result + RelationshipType.GetHashCode();
            return(result);
        }
コード例 #2
0
        /// <summary>
        ///     Returns a hash code for this instance.
        /// </summary>
        /// <returns>
        ///     A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
        /// </returns>
        public override int GetHashCode( )
        {
            int hash = 13;

            if (DateTime != null)
            {
                hash = (hash * 7) + DateTime.GetHashCode( );
            }

            if (Duration != null)
            {
                hash = (hash * 7) + Duration.GetHashCode( );
            }

            hash = (hash * 7) + Related.GetHashCode( );

            return(hash);
        }