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

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     ShipId == other.ShipId ||
                     ShipId != null &&
                     ShipId.Equals(other.ShipId)
                 ) &&
                 (
                     BookingDate == other.BookingDate ||
                     BookingDate != null &&
                     BookingDate.Equals(other.BookingDate)
                 ) &&
                 (
                     Price == other.Price ||
                     Price != null &&
                     Price.Equals(other.Price)
                 ));
        }
Example #2
0
        public bool Equals(ShipLocation?other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(ShipLocationId == other.ShipLocationId && ShipId.Equals(other.ShipId) &&
                   Heading.Equals(other.Heading) && Speed == other.Speed && X == other.X && Y == other.Y &&
                   Created.Equals(other.Created));
        }