src/Misc/EFTools/EntityDesignModel/ModelHelper.cs
/// <summary>
///     Returns the list of association connectors between the passed in entity-type-shape and other entity-type-shapes or itself.
/// </summary>
/// <param name="entityTypeShape"></param>
/// <returns></returns>
Returns the list of association connectors between the passed in entity-type-shape and other entity-type-shapes or itself.
Returns the list of association connectors between the passed in entity - type - shape and other entity - type - shapes or itself .
internal static IEnumerable<AssociationConnector> GetListOfAssociationConnectorsForEntityTypeShape(EntityTypeShape entityTypeShape)
        {
            var associationConnectors = new HashSet<AssociationConnector>();
            if (entityTypeShape == null)
            {
                Debug.Fail("argument entityTypeShape must not be null");
                return associationConnectors;
            }
            if (entityTypeShape.EntityType.SafeTarget == null)
            {
                Debug.Fail("argument entityTypeShape must reference an entity type.");
                return associationConnectors;
            }
            IEnumerable<Association> participatingAssociations =
                Association.GetAssociationsForEntityType(entityTypeShape.EntityType.SafeTarget);
            foreach (var association in participatingAssociations)
            {
                foreach (
                    var connector in
                        association.GetAntiDependenciesOfType<AssociationConnector>()
                            .Where(ac => ac.Diagram.Id == entityTypeShape.Diagram.Id))
                {
                    if (associationConnectors.Contains(connector) == false)
                    {
                        associationConnectors.Add(connector);
                    }
                }
            }
            return associationConnectors;
        }
internal static IEnumerable < AssociationConnector > GetListOfAssociationConnectorsForEntityTypeShape ( EntityTypeShape entityTypeShape ) { var associationConnectors = new HashSet < AssociationConnector > ( ) ; if ( entityTypeShape == null ) { Debug . Fail ( " " ) ; return associationConnectors ; } if ( entityTypeShape . EntityType . SafeTarget == null ) { Debug . Fail ( " " ) ; return associationConnectors ; } IEnumerable < Association > participatingAssociations = Association . GetAssociationsForEntityType ( entityTypeShape . EntityType . SafeTarget ) ; foreach ( var association in participatingAssociations ) { foreach ( var connector in association . GetAntiDependenciesOfType < AssociationConnector > ( ) . Where ( ac => ac . Diagram . Id == entityTypeShape . Diagram . Id ) ) { if ( associationConnectors . Contains ( connector ) == false ) { associationConnectors . Add ( connector ) ; } } } return associationConnectors ; }
Returns the list of association connectors between the passed in entity-type-shape and other entity-type-shapes or itself.
Returns the list of association connectors between the passed in entity - type - shape and other entity - type - shapes or itself .
// Find all associations which the entity type participates. // Find all all associationConnectors in the diagram.
None
entityTypeShape
EntityTypeShape
None