private void FixupOffresReference(OffresReference previousValue)
        {
            if (previousValue != null && previousValue.OffresReferencesTypeSessions.Contains(this))
            {
                previousValue.OffresReferencesTypeSessions.Remove(this);
            }

            if (OffresReference != null)
            {
                if (!OffresReference.OffresReferencesTypeSessions.Contains(this))
                {
                    OffresReference.OffresReferencesTypeSessions.Add(this);
                }
                if (OffresReferencesId != OffresReference.Id)
                {
                    OffresReferencesId = OffresReference.Id;
                }
            }
        }
Exemple #2
0
        private void FixupOffresReference(OffresReference previousValue)
        {
            if (previousValue != null && previousValue.Offres.Contains(this))
            {
                previousValue.Offres.Remove(this);
            }

            if (OffresReference != null)
            {
                if (!OffresReference.Offres.Contains(this))
                {
                    OffresReference.Offres.Add(this);
                }
                if (OffresReferencesId != OffresReference.Id)
                {
                    OffresReferencesId = OffresReference.Id;
                }
            }
            else if (!_settingFK)
            {
                OffresReferencesId = null;
            }
        }