src/Misc/EFTools/EntityDesignModel/Integrity/enforceentitysetmappingrules.cs
/// <summary>
///     This method makes sure that:
///     1. Any given item is not duplicated in the list
///     2. If the newDeleted item's parent is already in the list, don't add it
///     3. If any children of newDeleted are already in the list, remove the child item
///     This greatly optimizes the actually CleanUp() process.
/// </summary>
/// <param name="newDeleted"></param>
This method makes sure that:
1. Any given item is not duplicated in the list
2. If the newDeleted item's parent is already in the list, don't add it
3. If any children of newDeleted are already in the list, remove the child item
This greatly optimizes the actually CleanUp() process.
This method makes sure that : 1 . Any given item is not duplicated in the list 2 . If the newDeleted item ' s parent is already in the list don ' t add it 3 . If any children of newDeleted are already in the list remove the child item This greatly optimizes the actually CleanUp () process .
private void AddToDeleteList(EFObject newDeleted)
        {
            if (_itemsToDelete.Contains(newDeleted))
            {
                return;
            }
            var container = newDeleted.Parent;
            while (container != null)
            {
                if (_itemsToDelete.Contains(container))
                {
                    return;
                }
                container = container.Parent;
            }
            RemoveChildrenOfNewDeleted(newDeleted as EFContainer);
            _itemsToDelete.Add(newDeleted);
        }
private void AddToDeleteList ( EFObject newDeleted ) { if ( _itemsToDelete . Contains ( newDeleted ) ) { return ; } var container = newDeleted . Parent ; while ( container != null ) { if ( _itemsToDelete . Contains ( container ) ) { return ; } container = container . Parent ; } RemoveChildrenOfNewDeleted ( newDeleted as EFContainer ) ; _itemsToDelete . Add ( newDeleted ) ; }
This method makes sure that:
1.
This method makes sure that : 1 .
// if newDeleted is already there, just return // don't add newDeleted if any of its parents are already being deleted // if the newDeleted item is the parent of an existing item // remove the child item and just add the parent below // add the item
newDeleted
EFObject
None