示例#1
0
        /// <summary>
        /// Returns true if CarInfo instances are equal
        /// </summary>
        /// <param name="other">Instance of CarInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CarInfo other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Model == other.Model ||
                     Model != null &&
                     Model.Equals(other.Model)
                     ) &&
                 (
                     Year == other.Year ||
                     Year != null &&
                     Year.Equals(other.Year)
                 ) &&
                 (
                     Price == other.Price ||
                     Price != null &&
                     Price.Equals(other.Price)
                 ) &&
                 (
                     SerialNumber == other.SerialNumber ||
                     SerialNumber != null &&
                     SerialNumber.Equals(other.SerialNumber)
                 ) &&
                 (
                     SoldDateUtc == other.SoldDateUtc ||
                     SoldDateUtc != null &&
                     SoldDateUtc.Equals(other.SoldDateUtc)
                 ) &&
                 (
                     Comment == other.Comment ||
                     Comment != null &&
                     Comment.Equals(other.Comment)
                 ) &&
                 (
                     Transmission == other.Transmission ||
                     Transmission != null &&
                     Transmission.Equals(other.Transmission)
                 ) &&
                 (
                     Motor == other.Motor ||
                     Motor != null &&
                     Motor.Equals(other.Motor)
                 ) &&
                 (
                     GarageId == other.GarageId ||
                     GarageId != null &&
                     GarageId.Equals(other.GarageId)
                 ) &&
                 (
                     SellerId == other.SellerId ||
                     SellerId != null &&
                     SellerId.Equals(other.SellerId)
                 ));
        }