/// <summary> /// Returns true if Car instances are equal /// </summary> /// <param name="other">Instance of Car to be compared</param> /// <returns>Boolean</returns> public bool Equals(Car other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( IdCar == other.IdCar || IdCar.Equals(other.IdCar) ) && ( CarMake == other.CarMake || CarMake != null && CarMake.Equals(other.CarMake) ) && ( CarName == other.CarName || CarName != null && CarName.Equals(other.CarName) ) && ( CarNr == other.CarNr || CarNr != null && CarNr.Equals(other.CarNr) ) && ( CarType == other.CarType || CarType != null && CarType.Equals(other.CarType) ) && ( CarClass == other.CarClass || CarClass != null && CarClass.Equals(other.CarClass) )); }