private void FixupServiceSubscription(ServiceSubscriptionDto previousValue)
        {
            if (previousValue != null && previousValue.UsersXSubscriptions.Contains(this))
            {
                previousValue.UsersXSubscriptions.Remove(this);
            }

            if (ServiceSubscription != null)
            {
                if (!ServiceSubscription.UsersXSubscriptions.Contains(this))
                {
                    ServiceSubscription.UsersXSubscriptions.Add(this);
                }
                if (idSubscription != ServiceSubscription.idServiceSubscription)
                {
                    idSubscription = ServiceSubscription.idServiceSubscription;
                }
            }
        }
Esempio n. 2
0
        private void FixupServiceSubscription(ServiceSubscriptionDto previousValue)
        {
            if (previousValue != null && previousValue.ServiceDeliveries.Contains(this))
            {
                previousValue.ServiceDeliveries.Remove(this);
            }

            if (ServiceSubscription != null)
            {
                if (!ServiceSubscription.ServiceDeliveries.Contains(this))
                {
                    ServiceSubscription.ServiceDeliveries.Add(this);
                }
                if (IdServiceSubscription != ServiceSubscription.idServiceSubscription)
                {
                    IdServiceSubscription = ServiceSubscription.idServiceSubscription;
                }
            }
            else if (!_settingFK)
            {
                IdServiceSubscription = null;
            }
        }