public void AddCoupling(Coupling to) { if (Couplings.Any(x => x.To == to.To && ((x.FieldReference == null && to.FieldReference == null) || ((x.FieldReference != null && to.FieldReference != null) && (x.FieldReference.FullName == to.FieldReference.FullName))))) { return; } Couplings.Add(to); }
public bool Equals(Coupling other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.To, To) && Equals(other.ActualReference, ActualReference); }