public bool Equals(Flight other) { if (other != null) { return(Origin.Equals(other.Origin) && Destination.Equals(other.Destination) && DepartureTime.Equals(other.DepartureTime) && DestinationTime.Equals(other.DestinationTime) && Price.Equals(other.Price)); } return(false); }
public override bool Equals(Object obj) { if (obj.GetType() != typeof(FlightDetails)) { return(false); } FlightDetails fd = (obj as FlightDetails); return(Origin.Equals(fd.Origin) && Destination.Equals(fd.Destination) && Price == fd.Price && DepartureTime.Equals(fd.DepartureTime) && DestinationTime.Equals(fd.DestinationTime)); }