Exemplo n.º 1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (PageIndex != null)
         {
             hashCode = hashCode * 59 + PageIndex.GetHashCode();
         }
         if (TotalPages != null)
         {
             hashCode = hashCode * 59 + TotalPages.GetHashCode();
         }
         if (PageSize != null)
         {
             hashCode = hashCode * 59 + PageSize.GetHashCode();
         }
         if (Items != null)
         {
             hashCode = hashCode * 59 + Items.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 ///     用作特定类型的哈希函数。
 /// </summary>
 /// <returns>当前Object的哈希代码。</returns>
 /// <remarks>
 ///     有关此函数的更多信息,请参见:http://msdn.microsoft.com/zh-cn/library/system.object.gethashcode。
 /// </remarks>
 public override int GetHashCode()
 {
     return(TotalPages.GetHashCode() ^
            TotalRecords.GetHashCode() ^
            PageNumber.GetHashCode() ^
            PageSize.GetHashCode());
 }
        public override int GetHashCode()
        {
            int hash = 1;

            if (Page != 0L)
            {
                hash ^= Page.GetHashCode();
            }
            if (Size != 0L)
            {
                hash ^= Size.GetHashCode();
            }
            if (TotalPages != 0L)
            {
                hash ^= TotalPages.GetHashCode();
            }
            if (TotalItems != 0L)
            {
                hash ^= TotalItems.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)

                hashCode = hashCode * 59 + CurrentPage.GetHashCode();

                hashCode = hashCode * 59 + PageSize.GetHashCode();

                hashCode = hashCode * 59 + TotalCount.GetHashCode();

                hashCode = hashCode * 59 + TotalPages.GetHashCode();
                if (PreviousPageInputParameters != null)
                {
                    hashCode = hashCode * 59 + PreviousPageInputParameters.GetHashCode();
                }
                if (NextPageInputParameters != null)
                {
                    hashCode = hashCode * 59 + NextPageInputParameters.GetHashCode();
                }
                return(hashCode);
            }
        }