Esempio 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 (AgentNumericCode != null)
         {
             hashCode = hashCode * 59 + AgentNumericCode.GetHashCode();
         }
         if (Code != null)
         {
             hashCode = hashCode * 59 + Code.GetHashCode();
         }
         if (FlightDate != null)
         {
             hashCode = hashCode * 59 + FlightDate.GetHashCode();
         }
         if (FlightLegs != null)
         {
             hashCode = hashCode * 59 + FlightLegs.GetHashCode();
         }
         if (InvoiceNumber != null)
         {
             hashCode = hashCode * 59 + InvoiceNumber.GetHashCode();
         }
         if (IsETicket != null)
         {
             hashCode = hashCode * 59 + IsETicket.GetHashCode();
         }
         if (IsRegisteredCustomer != null)
         {
             hashCode = hashCode * 59 + IsRegisteredCustomer.GetHashCode();
         }
         if (IsRestrictedTicket != null)
         {
             hashCode = hashCode * 59 + IsRestrictedTicket.GetHashCode();
         }
         if (IsThirdParty != null)
         {
             hashCode = hashCode * 59 + IsThirdParty.GetHashCode();
         }
         if (IssueDate != null)
         {
             hashCode = hashCode * 59 + IssueDate.GetHashCode();
         }
         if (MerchantCustomerId != null)
         {
             hashCode = hashCode * 59 + MerchantCustomerId.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (PassengerName != null)
         {
             hashCode = hashCode * 59 + PassengerName.GetHashCode();
         }
         if (Passengers != null)
         {
             hashCode = hashCode * 59 + Passengers.GetHashCode();
         }
         if (PlaceOfIssue != null)
         {
             hashCode = hashCode * 59 + PlaceOfIssue.GetHashCode();
         }
         if (Pnr != null)
         {
             hashCode = hashCode * 59 + Pnr.GetHashCode();
         }
         if (PointOfSale != null)
         {
             hashCode = hashCode * 59 + PointOfSale.GetHashCode();
         }
         if (PosCityCode != null)
         {
             hashCode = hashCode * 59 + PosCityCode.GetHashCode();
         }
         if (TicketDeliveryMethod != null)
         {
             hashCode = hashCode * 59 + TicketDeliveryMethod.GetHashCode();
         }
         if (TicketNumber != null)
         {
             hashCode = hashCode * 59 + TicketNumber.GetHashCode();
         }
         if (TotalFare != null)
         {
             hashCode = hashCode * 59 + TotalFare.GetHashCode();
         }
         if (TotalFee != null)
         {
             hashCode = hashCode * 59 + TotalFee.GetHashCode();
         }
         if (TotalTaxes != null)
         {
             hashCode = hashCode * 59 + TotalTaxes.GetHashCode();
         }
         if (TravelAgencyName != null)
         {
             hashCode = hashCode * 59 + TravelAgencyName.GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Returns true if AirlineData instances are equal
        /// </summary>
        /// <param name="other">Instance of AirlineData to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(AirlineData other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AgentNumericCode == other.AgentNumericCode ||
                     AgentNumericCode != null &&
                     AgentNumericCode.Equals(other.AgentNumericCode)
                     ) &&
                 (
                     Code == other.Code ||
                     Code != null &&
                     Code.Equals(other.Code)
                 ) &&
                 (
                     FlightDate == other.FlightDate ||
                     FlightDate != null &&
                     FlightDate.Equals(other.FlightDate)
                 ) &&
                 (
                     FlightLegs == other.FlightLegs ||
                     FlightLegs != null &&
                     FlightLegs.SequenceEqual(other.FlightLegs)
                 ) &&
                 (
                     InvoiceNumber == other.InvoiceNumber ||
                     InvoiceNumber != null &&
                     InvoiceNumber.Equals(other.InvoiceNumber)
                 ) &&
                 (
                     IsETicket == other.IsETicket ||
                     IsETicket != null &&
                     IsETicket.Equals(other.IsETicket)
                 ) &&
                 (
                     IsRegisteredCustomer == other.IsRegisteredCustomer ||
                     IsRegisteredCustomer != null &&
                     IsRegisteredCustomer.Equals(other.IsRegisteredCustomer)
                 ) &&
                 (
                     IsRestrictedTicket == other.IsRestrictedTicket ||
                     IsRestrictedTicket != null &&
                     IsRestrictedTicket.Equals(other.IsRestrictedTicket)
                 ) &&
                 (
                     IsThirdParty == other.IsThirdParty ||
                     IsThirdParty != null &&
                     IsThirdParty.Equals(other.IsThirdParty)
                 ) &&
                 (
                     IssueDate == other.IssueDate ||
                     IssueDate != null &&
                     IssueDate.Equals(other.IssueDate)
                 ) &&
                 (
                     MerchantCustomerId == other.MerchantCustomerId ||
                     MerchantCustomerId != null &&
                     MerchantCustomerId.Equals(other.MerchantCustomerId)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     PassengerName == other.PassengerName ||
                     PassengerName != null &&
                     PassengerName.Equals(other.PassengerName)
                 ) &&
                 (
                     Passengers == other.Passengers ||
                     Passengers != null &&
                     Passengers.SequenceEqual(other.Passengers)
                 ) &&
                 (
                     PlaceOfIssue == other.PlaceOfIssue ||
                     PlaceOfIssue != null &&
                     PlaceOfIssue.Equals(other.PlaceOfIssue)
                 ) &&
                 (
                     Pnr == other.Pnr ||
                     Pnr != null &&
                     Pnr.Equals(other.Pnr)
                 ) &&
                 (
                     PointOfSale == other.PointOfSale ||
                     PointOfSale != null &&
                     PointOfSale.Equals(other.PointOfSale)
                 ) &&
                 (
                     PosCityCode == other.PosCityCode ||
                     PosCityCode != null &&
                     PosCityCode.Equals(other.PosCityCode)
                 ) &&
                 (
                     TicketDeliveryMethod == other.TicketDeliveryMethod ||
                     TicketDeliveryMethod != null &&
                     TicketDeliveryMethod.Equals(other.TicketDeliveryMethod)
                 ) &&
                 (
                     TicketNumber == other.TicketNumber ||
                     TicketNumber != null &&
                     TicketNumber.Equals(other.TicketNumber)
                 ) &&
                 (
                     TotalFare == other.TotalFare ||
                     TotalFare != null &&
                     TotalFare.Equals(other.TotalFare)
                 ) &&
                 (
                     TotalFee == other.TotalFee ||
                     TotalFee != null &&
                     TotalFee.Equals(other.TotalFee)
                 ) &&
                 (
                     TotalTaxes == other.TotalTaxes ||
                     TotalTaxes != null &&
                     TotalTaxes.Equals(other.TotalTaxes)
                 ) &&
                 (
                     TravelAgencyName == other.TravelAgencyName ||
                     TravelAgencyName != null &&
                     TravelAgencyName.Equals(other.TravelAgencyName)
                 ));
        }