public bool Equals(Airport other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; if (other.Id == 0 && Id == 0) return false; else return other.Id == Id; }
private void FixupAirport(Airport previousValue, bool skipKeys = false) { if (IsDeserializing) { return; } if (Airport != null) { AirportId = Airport.Id; } else if (!skipKeys) { AirportId = null; } if (ChangeTracker.ChangeTrackingEnabled) { if (ChangeTracker.OriginalValues.ContainsKey("Airport") && (ChangeTracker.OriginalValues["Airport"] == Airport)) { ChangeTracker.OriginalValues.Remove("Airport"); } else { ChangeTracker.RecordOriginalValue("Airport", previousValue); } if (Airport != null && !Airport.ChangeTracker.ChangeTrackingEnabled) { Airport.StartTracking(); } } }
private void FixupAirport(Airport previousValue) { if (IsDeserializing) { return; } if (previousValue != null && previousValue.MeetingPoints.Contains(this)) { previousValue.MeetingPoints.Remove(this); } if (Airport != null) { if (!Airport.MeetingPoints.Contains(this)) { Airport.MeetingPoints.Add(this); } AirportId = Airport.Id; } if (ChangeTracker.ChangeTrackingEnabled) { if (ChangeTracker.OriginalValues.ContainsKey("Airport") && (ChangeTracker.OriginalValues["Airport"] == Airport)) { ChangeTracker.OriginalValues.Remove("Airport"); } else { ChangeTracker.RecordOriginalValue("Airport", previousValue); } if (Airport != null && !Airport.ChangeTracker.ChangeTrackingEnabled) { Airport.StartTracking(); } } }