private void FixupStore(Store previousValue)
        {
            if (previousValue != null && previousValue.StoreContacts.Contains(this))
            {
                previousValue.StoreContacts.Remove(this);
            }

            if (Store != null)
            {
                if (!Store.StoreContacts.Contains(this))
                {
                    Store.StoreContacts.Add(this);
                }
                if (CustomerID != Store.CustomerID)
                {
                    CustomerID = Store.CustomerID;
                }
            }
        }
Example #2
0
        private void FixupStore(Store previousValue)
        {
            if (previousValue != null && ReferenceEquals(previousValue.Customer, this))
            {
                previousValue.Customer = null;
            }

            if (Store != null)
            {
                Store.Customer = this;
            }
        }