private void FixupBusinessEntity(BusinessEntity previousValue)
        {
            if (previousValue != null && previousValue.BusinessEntityAddresses.Contains(this))
            {
                previousValue.BusinessEntityAddresses.Remove(this);
            }

            if (BusinessEntity != null)
            {
                if (!BusinessEntity.BusinessEntityAddresses.Contains(this))
                {
                    BusinessEntity.BusinessEntityAddresses.Add(this);
                }
                if (BusinessEntityID != BusinessEntity.BusinessEntityID)
                {
                    BusinessEntityID = BusinessEntity.BusinessEntityID;
                }
            }
        }
Beispiel #2
0
        private void FixupBusinessEntity(BusinessEntity previousValue)
        {
            if (previousValue != null && ReferenceEquals(previousValue.Vendor, this))
            {
                previousValue.Vendor = null;
            }

            if (BusinessEntity != null)
            {
                BusinessEntity.Vendor = this;
                if (BusinessEntityID != BusinessEntity.BusinessEntityID)
                {
                    BusinessEntityID = BusinessEntity.BusinessEntityID;
                }
            }
        }