コード例 #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 :)

                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);
            }
        }
コード例 #2
0
        /// <summary>
        /// Returns true if XPaginationHeader instances are equal
        /// </summary>
        /// <param name="other">Instance of XPaginationHeader to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(XPaginationHeader other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CurrentPage == other.CurrentPage ||

                     CurrentPage.Equals(other.CurrentPage)
                     ) &&
                 (
                     PageSize == other.PageSize ||

                     PageSize.Equals(other.PageSize)
                 ) &&
                 (
                     TotalCount == other.TotalCount ||

                     TotalCount.Equals(other.TotalCount)
                 ) &&
                 (
                     TotalPages == other.TotalPages ||

                     TotalPages.Equals(other.TotalPages)
                 ) &&
                 (
                     PreviousPageInputParameters == other.PreviousPageInputParameters ||
                     PreviousPageInputParameters != null &&
                     PreviousPageInputParameters.Equals(other.PreviousPageInputParameters)
                 ) &&
                 (
                     NextPageInputParameters == other.NextPageInputParameters ||
                     NextPageInputParameters != null &&
                     NextPageInputParameters.Equals(other.NextPageInputParameters)
                 ));
        }