src/Misc/EFTools/EntityDesignModel/Commands/DeleteEntityTypeCommand.cs
/// <summary>
///     Constructs a list of the Associations to be deleted given a to-be-deleted EntityType
/// </summary>
/// <param name="entityType">the EntityType</param>
/// <returns>list of the Associations to be deleted</returns>
Constructs a list of the Associations to be deleted given a to-be-deleted EntityType
Constructs a list of the Associations to be deleted given a to - be - deleted EntityType
internal static List<Association> GetListOfAssociationsToBeDeleted(EntityType entityType)
        {
            var assocsToDelete = new List<Association>();
            if (entityType == null)
            {
                Debug.Fail("argument entityType must not be null");
                return assocsToDelete;
            }
            foreach (var associationEnd in entityType.GetAntiDependenciesOfType<AssociationEnd>())
            {
                var association = associationEnd.Parent as Association;
                Debug.Assert(association != null, " null association for AssociationEnd" + associationEnd.ToPrettyString());
                if (association != null
                    && association.XObject != null)
                {
                    assocsToDelete.Add(association);
                }
            }
            return assocsToDelete;
        }
internal static List < Association > GetListOfAssociationsToBeDeleted ( EntityType entityType ) { var assocsToDelete = new List < Association > ( ) ; if ( entityType == null ) { Debug . Fail ( " " ) ; return assocsToDelete ; } foreach ( var associationEnd in entityType . GetAntiDependenciesOfType < AssociationEnd > ( ) ) { var association = associationEnd . Parent as Association ; Debug . Assert ( association != null , " " + associationEnd . ToPrettyString ( ) ) ; if ( association != null && association . XObject != null ) { assocsToDelete . Add ( association ) ; } } return assocsToDelete ; }
Constructs a list of the Associations to be deleted given a to-be-deleted EntityType
Constructs a list of the Associations to be deleted given a to - be - deleted EntityType
// if this entity is used in an AssociationEnd, the entire Association should be deleted
list of the Associations to be deleted
list of the Associations to be deleted
entityType
EntityType
None