/// <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 (MaintenanceMargin != null) { hashCode = hashCode * 59 + MaintenanceMargin.GetHashCode(); } if (AvailableWithdrawalFunds != null) { hashCode = hashCode * 59 + AvailableWithdrawalFunds.GetHashCode(); } if (InitialMargin != null) { hashCode = hashCode * 59 + InitialMargin.GetHashCode(); } if (AvailableFunds != null) { hashCode = hashCode * 59 + AvailableFunds.GetHashCode(); } hashCode = hashCode * 59 + Currency.GetHashCode(); if (MarginBalance != null) { hashCode = hashCode * 59 + MarginBalance.GetHashCode(); } if (Equity != null) { hashCode = hashCode * 59 + Equity.GetHashCode(); } if (Balance != null) { hashCode = hashCode * 59 + Balance.GetHashCode(); } return(hashCode); } }
/// <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 + Direction.GetHashCode(); if (AveragePriceUsd != null) { hashCode = hashCode * 59 + AveragePriceUsd.GetHashCode(); } if (EstimatedLiquidationPrice != null) { hashCode = hashCode * 59 + EstimatedLiquidationPrice.GetHashCode(); } if (FloatingProfitLoss != null) { hashCode = hashCode * 59 + FloatingProfitLoss.GetHashCode(); } if (FloatingProfitLossUsd != null) { hashCode = hashCode * 59 + FloatingProfitLossUsd.GetHashCode(); } if (OpenOrdersMargin != null) { hashCode = hashCode * 59 + OpenOrdersMargin.GetHashCode(); } if (TotalProfitLoss != null) { hashCode = hashCode * 59 + TotalProfitLoss.GetHashCode(); } if (RealizedProfitLoss != null) { hashCode = hashCode * 59 + RealizedProfitLoss.GetHashCode(); } if (Delta != null) { hashCode = hashCode * 59 + Delta.GetHashCode(); } if (InitialMargin != null) { hashCode = hashCode * 59 + InitialMargin.GetHashCode(); } if (Size != null) { hashCode = hashCode * 59 + Size.GetHashCode(); } if (MaintenanceMargin != null) { hashCode = hashCode * 59 + MaintenanceMargin.GetHashCode(); } hashCode = hashCode * 59 + Kind.GetHashCode(); if (MarkPrice != null) { hashCode = hashCode * 59 + MarkPrice.GetHashCode(); } if (AveragePrice != null) { hashCode = hashCode * 59 + AveragePrice.GetHashCode(); } if (SettlementPrice != null) { hashCode = hashCode * 59 + SettlementPrice.GetHashCode(); } if (IndexPrice != null) { hashCode = hashCode * 59 + IndexPrice.GetHashCode(); } if (InstrumentName != null) { hashCode = hashCode * 59 + InstrumentName.GetHashCode(); } if (SizeCurrency != null) { hashCode = hashCode * 59 + SizeCurrency.GetHashCode(); } return(hashCode); } }