private void FixupState(State previousValue) { if (previousValue != null && previousValue.Companies.Contains(this)) { previousValue.Companies.Remove(this); } if (State != null) { if (!State.Companies.Contains(this)) { State.Companies.Add(this); } if (StateID != State.ID) { StateID = State.ID; } } }
private void FixupState(State previousValue) { if (previousValue != null && previousValue.Contacts.Contains(this)) { previousValue.Contacts.Remove(this); } if (State != null) { if (!State.Contacts.Contains(this)) { State.Contacts.Add(this); } if (StateID != State.ID) { StateID = State.ID; } } else if (!_settingFK) { StateID = null; } }