Ejemplo n.º 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 (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Consumer != null)
         {
             hashCode = hashCode * 59 + Consumer.GetHashCode();
         }
         if (Store != null)
         {
             hashCode = hashCode * 59 + Store.GetHashCode();
         }
         if (Subtotal != null)
         {
             hashCode = hashCode * 59 + Subtotal.GetHashCode();
         }
         if (Tax != null)
         {
             hashCode = hashCode * 59 + Tax.GetHashCode();
         }
         if (EstimatedPickupTime != null)
         {
             hashCode = hashCode * 59 + EstimatedPickupTime.GetHashCode();
         }
         if (IsPickup != null)
         {
             hashCode = hashCode * 59 + IsPickup.GetHashCode();
         }
         if (Categories != null)
         {
             hashCode = hashCode * 59 + Categories.GetHashCode();
         }
         if (IsTaxRemittedByDoordash != null)
         {
             hashCode = hashCode * 59 + IsTaxRemittedByDoordash.GetHashCode();
         }
         if (TaxAmountRemittedByDoordash != null)
         {
             hashCode = hashCode * 59 + TaxAmountRemittedByDoordash.GetHashCode();
         }
         if (CommissionType != null)
         {
             hashCode = hashCode * 59 + CommissionType.GetHashCode();
         }
         if (DeliveryShortCode != null)
         {
             hashCode = hashCode * 59 + DeliveryShortCode.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns true if Order instances are equal
        /// </summary>
        /// <param name="input">Instance of Order to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Order input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Id == input.Id ||
                     Id != null &&
                     Id.Equals(input.Id)
                     ) &&
                 (
                     Consumer == input.Consumer ||
                     Consumer != null &&
                     Consumer.Equals(input.Consumer)
                 ) &&
                 (
                     Store == input.Store ||
                     Store != null &&
                     Store.Equals(input.Store)
                 ) &&
                 (
                     Subtotal == input.Subtotal ||
                     Subtotal != null &&
                     Subtotal.Equals(input.Subtotal)
                 ) &&
                 (
                     Tax == input.Tax ||
                     Tax != null &&
                     Tax.Equals(input.Tax)
                 ) &&
                 (
                     EstimatedPickupTime == input.EstimatedPickupTime ||
                     EstimatedPickupTime != null &&
                     EstimatedPickupTime.Equals(input.EstimatedPickupTime)
                 ) &&
                 (
                     IsPickup == input.IsPickup ||
                     IsPickup != null &&
                     IsPickup.Equals(input.IsPickup)
                 ) &&
                 (
                     Categories == input.Categories ||
                     Categories != null &&
                     Categories.SequenceEqual(input.Categories)
                 ) &&
                 (
                     IsTaxRemittedByDoordash == input.IsTaxRemittedByDoordash ||
                     IsTaxRemittedByDoordash != null &&
                     IsTaxRemittedByDoordash.Equals(input.IsTaxRemittedByDoordash)
                 ) &&
                 (
                     TaxAmountRemittedByDoordash == input.TaxAmountRemittedByDoordash ||
                     TaxAmountRemittedByDoordash != null &&
                     TaxAmountRemittedByDoordash.Equals(input.TaxAmountRemittedByDoordash)
                 ) &&
                 (
                     CommissionType == input.CommissionType ||
                     CommissionType != null &&
                     CommissionType.Equals(input.CommissionType)
                 ) &&
                 (
                     DeliveryShortCode == input.DeliveryShortCode ||
                     DeliveryShortCode != null &&
                     DeliveryShortCode.Equals(input.DeliveryShortCode)
                 ));
        }