예제 #1
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (OrderId != null)
                {
                    hashCode = hashCode * 59 + OrderId.GetHashCode();
                }

                if (UserId != null)
                {
                    hashCode = hashCode * 59 + UserId.GetHashCode();
                }

                if (Symbol != null)
                {
                    hashCode = hashCode * 59 + Symbol.GetHashCode();
                }

                if (Side != null)
                {
                    hashCode = hashCode * 59 + Side.GetHashCode();
                }

                if (OrderType != null)
                {
                    hashCode = hashCode * 59 + OrderType.GetHashCode();
                }

                if (Price != null)
                {
                    hashCode = hashCode * 59 + Price.GetHashCode();
                }

                if (TimeInForce != null)
                {
                    hashCode = hashCode * 59 + TimeInForce.GetHashCode();
                }

                if (OrderStatus != null)
                {
                    hashCode = hashCode * 59 + OrderStatus.GetHashCode();
                }

                if (LastExecTime != null)
                {
                    hashCode = hashCode * 59 + LastExecTime.GetHashCode();
                }

                if (LastExecPrice != null)
                {
                    hashCode = hashCode * 59 + LastExecPrice.GetHashCode();
                }

                if (LeavesQty != null)
                {
                    hashCode = hashCode * 59 + LeavesQty.GetHashCode();
                }

                if (CumExecQty != null)
                {
                    hashCode = hashCode * 59 + CumExecQty.GetHashCode();
                }

                if (CumExecValue != null)
                {
                    hashCode = hashCode * 59 + CumExecValue.GetHashCode();
                }

                if (CumExecFee != null)
                {
                    hashCode = hashCode * 59 + CumExecFee.GetHashCode();
                }

                if (RejectReason != null)
                {
                    hashCode = hashCode * 59 + RejectReason.GetHashCode();
                }

                if (OrderLinkId != null)
                {
                    hashCode = hashCode * 59 + OrderLinkId.GetHashCode();
                }

                if (CreatedAt != null)
                {
                    hashCode = hashCode * 59 + CreatedAt.GetHashCode();
                }

                if (UpdatedAt != null)
                {
                    hashCode = hashCode * 59 + UpdatedAt.GetHashCode();
                }

                return(hashCode);
            }
        }
예제 #2
0
        /// <summary>
        /// Returns true if OrderRes instances are equal
        /// </summary>
        /// <param name="input">Instance of OrderRes to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OrderRes input)
        {
            if (input == null)
            {
                return(false);
            }

            return((
                       OrderId == input.OrderId ||
                       (OrderId != null &&
                        OrderId.Equals(input.OrderId))
                       ) &&
                   (
                       UserId == input.UserId ||
                       (UserId != null &&
                        UserId.Equals(input.UserId))
                   ) &&
                   (
                       Symbol == input.Symbol ||
                       (Symbol != null &&
                        Symbol.Equals(input.Symbol))
                   ) &&
                   (
                       Side == input.Side ||
                       (Side != null &&
                        Side.Equals(input.Side))
                   ) &&
                   (
                       OrderType == input.OrderType ||
                       (OrderType != null &&
                        OrderType.Equals(input.OrderType))
                   ) &&
                   (
                       Price == input.Price ||
                       (Price != null &&
                        Price.Equals(input.Price))
                   ) &&
                   (
                       TimeInForce == input.TimeInForce ||
                       (TimeInForce != null &&
                        TimeInForce.Equals(input.TimeInForce))
                   ) &&
                   (
                       OrderStatus == input.OrderStatus ||
                       (OrderStatus != null &&
                        OrderStatus.Equals(input.OrderStatus))
                   ) &&
                   (
                       LastExecTime == input.LastExecTime ||
                       (LastExecTime != null &&
                        LastExecTime.Equals(input.LastExecTime))
                   ) &&
                   (
                       LastExecPrice == input.LastExecPrice ||
                       (LastExecPrice != null &&
                        LastExecPrice.Equals(input.LastExecPrice))
                   ) &&
                   (
                       LeavesQty == input.LeavesQty ||
                       (LeavesQty != null &&
                        LeavesQty.Equals(input.LeavesQty))
                   ) &&
                   (
                       CumExecQty == input.CumExecQty ||
                       (CumExecQty != null &&
                        CumExecQty.Equals(input.CumExecQty))
                   ) &&
                   (
                       CumExecValue == input.CumExecValue ||
                       (CumExecValue != null &&
                        CumExecValue.Equals(input.CumExecValue))
                   ) &&
                   (
                       CumExecFee == input.CumExecFee ||
                       (CumExecFee != null &&
                        CumExecFee.Equals(input.CumExecFee))
                   ) &&
                   (
                       RejectReason == input.RejectReason ||
                       (RejectReason != null &&
                        RejectReason.Equals(input.RejectReason))
                   ) &&
                   (
                       OrderLinkId == input.OrderLinkId ||
                       (OrderLinkId != null &&
                        OrderLinkId.Equals(input.OrderLinkId))
                   ) &&
                   (
                       CreatedAt == input.CreatedAt ||
                       (CreatedAt != null &&
                        CreatedAt.Equals(input.CreatedAt))
                   ) &&
                   (
                       UpdatedAt == input.UpdatedAt ||
                       (UpdatedAt != null &&
                        UpdatedAt.Equals(input.UpdatedAt))
                   ));
        }