Ejemplo 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 (LockedUpFunds != null)
         {
             hashCode = hashCode * 59 + LockedUpFunds.GetHashCode();
         }
         if (TotalNAV != null)
         {
             hashCode = hashCode * 59 + TotalNAV.GetHashCode();
         }
         if (Currency != null)
         {
             hashCode = hashCode * 59 + Currency.GetHashCode();
         }
         if (FreeCash != null)
         {
             hashCode = hashCode * 59 + FreeCash.GetHashCode();
         }
         if (UnsettledTrades != null)
         {
             hashCode = hashCode * 59 + UnsettledTrades.GetHashCode();
         }
         if (Withdrawable != null)
         {
             hashCode = hashCode * 59 + Withdrawable.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns true if CashLockedUpWithdrawableResponse instances are equal
        /// </summary>
        /// <param name="other">Instance of CashLockedUpWithdrawableResponse to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CashLockedUpWithdrawableResponse other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     LockedUpFunds == other.LockedUpFunds ||
                     LockedUpFunds != null &&
                     LockedUpFunds.Equals(other.LockedUpFunds)
                     ) &&
                 (
                     TotalNAV == other.TotalNAV ||
                     TotalNAV != null &&
                     TotalNAV.Equals(other.TotalNAV)
                 ) &&
                 (
                     Currency == other.Currency ||
                     Currency != null &&
                     Currency.Equals(other.Currency)
                 ) &&
                 (
                     FreeCash == other.FreeCash ||
                     FreeCash != null &&
                     FreeCash.Equals(other.FreeCash)
                 ) &&
                 (
                     UnsettledTrades == other.UnsettledTrades ||
                     UnsettledTrades != null &&
                     UnsettledTrades.Equals(other.UnsettledTrades)
                 ) &&
                 (
                     Withdrawable == other.Withdrawable ||
                     Withdrawable != null &&
                     Withdrawable.Equals(other.Withdrawable)
                 ));
        }