Exemple #1
0
        public override int GetHashCode()
        {
            if (ProductName == null)
            {
                return(base.GetHashCode());
            }
            var hash = 13;

            hash = (hash * 7) + ProductName.GetHashCode();
            hash = (hash * 7) + Topic.GetHashCode();
            hash = (hash * 7) + Type.GetHashCode();
            return(hash);
        }
Exemple #2
0
        /// <summary>
        /// Вычисляет хэш-код
        /// из полей категории
        /// </summary>
        /// <returns>
        /// Хэш-код
        /// из полей категории
        /// </returns>
        public override int GetHashCode()
        {
            if (ProductName == null)
            {
                return(base.GetHashCode());
            }
            var hashCode = 10;

            hashCode = hashCode * 5 + ProductName.GetHashCode();
            hashCode = hashCode * 4 + Type.GetHashCode();
            hashCode = hashCode * 3 + Topic.GetHashCode();
            return(hashCode);
        }
Exemple #3
0
 public override int GetHashCode()
 {
     return(1001 * productName.GetHashCode()
            + 101 * messageType.GetHashCode()
            + 11 * messageTopic.GetHashCode());
 }