Exemple #1
0
        /// <summary>
        ///     Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                var hash = 41;
                // Suitable nullity checks etc, of course :)

                if (Rid != null)
                {
                    hash = hash * 57 + Rid.GetHashCode();
                }

                if (Count != null)
                {
                    hash = hash * 57 + Count.GetHashCode();
                }

                if (ResourceArray != null)
                {
                    hash = hash * 57 + ResourceArray.GetHashCode();
                }

                if (Date != null)
                {
                    hash = hash * 57 + Date.GetHashCode();
                }

                if (XMsItemCount != null)
                {
                    hash = hash * 57 + XMsItemCount.GetHashCode();
                }

                if (XMsContinuation != null)
                {
                    hash = hash * 57 + XMsContinuation.GetHashCode();
                }

                if (XMsRequestCharge != null)
                {
                    hash = hash * 57 + XMsRequestCharge.GetHashCode();
                }

                if (XMsActivityId != null)
                {
                    hash = hash * 57 + XMsActivityId.GetHashCode();
                }

                if (XMsSessionToken != null)
                {
                    hash = hash * 57 + XMsSessionToken.GetHashCode();
                }

                return(hash);
            }
        }
Exemple #2
0
        /// <summary>
        ///     Returns true if QueryResourceResponseBody instances are equal
        /// </summary>
        /// <param name="other">Instance of QueryResourceResponseBody to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(QueryResourceResponseBody other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
            {
                return(false);
            }

            return
                ((
                     Rid == other.Rid ||
                     Rid != null &&
                     Rid.Equals(other.Rid)
                     ) &&
                 (
                     Count == other.Count ||
                     Count != null &&
                     Count.Equals(other.Count)
                 ) &&
                 (
                     ResourceArray == other.ResourceArray ||
                     ResourceArray != null &&
                     ResourceArray.Equals(other.ResourceArray)
                 ) &&
                 (
                     Date == other.Date ||
                     Date != null &&
                     Date.Equals(other.Date)
                 ) &&
                 (
                     XMsItemCount == other.XMsItemCount ||
                     XMsItemCount != null &&
                     XMsItemCount.Equals(other.XMsItemCount)
                 ) &&
                 (
                     XMsContinuation == other.XMsContinuation ||
                     XMsContinuation != null &&
                     XMsContinuation.Equals(other.XMsContinuation)
                 ) &&
                 (
                     XMsRequestCharge == other.XMsRequestCharge ||
                     XMsRequestCharge != null &&
                     XMsRequestCharge.Equals(other.XMsRequestCharge)
                 ) &&
                 (
                     XMsActivityId == other.XMsActivityId ||
                     XMsActivityId != null &&
                     XMsActivityId.Equals(other.XMsActivityId)
                 ) &&
                 (
                     XMsSessionToken == other.XMsSessionToken ||
                     XMsSessionToken != null &&
                     XMsSessionToken.Equals(other.XMsSessionToken)
                 ));
        }