public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is InventoryAdjustment other &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((ReferenceId == null && other.ReferenceId == null) || (ReferenceId?.Equals(other.ReferenceId) == true)) &&
                   ((FromState == null && other.FromState == null) || (FromState?.Equals(other.FromState) == true)) &&
                   ((ToState == null && other.ToState == null) || (ToState?.Equals(other.ToState) == true)) &&
                   ((LocationId == null && other.LocationId == null) || (LocationId?.Equals(other.LocationId) == true)) &&
                   ((CatalogObjectId == null && other.CatalogObjectId == null) || (CatalogObjectId?.Equals(other.CatalogObjectId) == true)) &&
                   ((CatalogObjectType == null && other.CatalogObjectType == null) || (CatalogObjectType?.Equals(other.CatalogObjectType) == true)) &&
                   ((Quantity == null && other.Quantity == null) || (Quantity?.Equals(other.Quantity) == true)) &&
                   ((TotalPriceMoney == null && other.TotalPriceMoney == null) || (TotalPriceMoney?.Equals(other.TotalPriceMoney) == true)) &&
                   ((OccurredAt == null && other.OccurredAt == null) || (OccurredAt?.Equals(other.OccurredAt) == true)) &&
                   ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) &&
                   ((Source == null && other.Source == null) || (Source?.Equals(other.Source) == true)) &&
                   ((EmployeeId == null && other.EmployeeId == null) || (EmployeeId?.Equals(other.EmployeeId) == true)) &&
                   ((TransactionId == null && other.TransactionId == null) || (TransactionId?.Equals(other.TransactionId) == true)) &&
                   ((RefundId == null && other.RefundId == null) || (RefundId?.Equals(other.RefundId) == true)) &&
                   ((PurchaseOrderId == null && other.PurchaseOrderId == null) || (PurchaseOrderId?.Equals(other.PurchaseOrderId) == true)) &&
                   ((GoodsReceiptId == null && other.GoodsReceiptId == null) || (GoodsReceiptId?.Equals(other.GoodsReceiptId) == true)));
        }
Esempio n. 2
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 17;
         hash = hash * 23 + (DueDate == default(DateTime) ? 0 : DueDate.GetHashCode());
         hash = hash * 23 + (LineTotal == default(decimal) ? 0 : LineTotal.GetHashCode());
         hash = hash * 23 + (ModifiedDate == default(DateTime) ? 0 : ModifiedDate.GetHashCode());
         hash = hash * 23 + (OrderQty == default(short) ? 0 : OrderQty.GetHashCode());
         hash = hash * 23 + (ProductId == default(int) ? 0 : ProductId.GetHashCode());
         hash = hash * 23 + (PurchaseOrderId == default(int) ? 0 : PurchaseOrderId.GetHashCode());
         hash = hash * 23 + (ReceivedQty == default(decimal) ? 0 : ReceivedQty.GetHashCode());
         hash = hash * 23 + (RejectedQty == default(decimal) ? 0 : RejectedQty.GetHashCode());
         hash = hash * 23 + (StockedQty == default(decimal) ? 0 : StockedQty.GetHashCode());
         hash = hash * 23 + (UnitPrice == default(decimal) ? 0 : UnitPrice.GetHashCode());
         return(hash);
     }
 }
        public override int GetHashCode()
        {
            int hashCode = -855846569;

            if (Id != null)
            {
                hashCode += Id.GetHashCode();
            }

            if (ReferenceId != null)
            {
                hashCode += ReferenceId.GetHashCode();
            }

            if (FromState != null)
            {
                hashCode += FromState.GetHashCode();
            }

            if (ToState != null)
            {
                hashCode += ToState.GetHashCode();
            }

            if (LocationId != null)
            {
                hashCode += LocationId.GetHashCode();
            }

            if (CatalogObjectId != null)
            {
                hashCode += CatalogObjectId.GetHashCode();
            }

            if (CatalogObjectType != null)
            {
                hashCode += CatalogObjectType.GetHashCode();
            }

            if (Quantity != null)
            {
                hashCode += Quantity.GetHashCode();
            }

            if (TotalPriceMoney != null)
            {
                hashCode += TotalPriceMoney.GetHashCode();
            }

            if (OccurredAt != null)
            {
                hashCode += OccurredAt.GetHashCode();
            }

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

            if (Source != null)
            {
                hashCode += Source.GetHashCode();
            }

            if (EmployeeId != null)
            {
                hashCode += EmployeeId.GetHashCode();
            }

            if (TransactionId != null)
            {
                hashCode += TransactionId.GetHashCode();
            }

            if (RefundId != null)
            {
                hashCode += RefundId.GetHashCode();
            }

            if (PurchaseOrderId != null)
            {
                hashCode += PurchaseOrderId.GetHashCode();
            }

            if (GoodsReceiptId != null)
            {
                hashCode += GoodsReceiptId.GetHashCode();
            }

            return(hashCode);
        }