src/Misc/EFTools/EntityDesignModel/ModelHelper.cs
/// <summary>
///     Return the list of inheritance connectors between the passed in entity-type=shape and its derived or base entity-type-shapes.
/// </summary>
/// <param name="entityTypeShape"></param>
/// <returns></returns>
Return the list of inheritance connectors between the passed in entity-type=shape and its derived or base entity-type-shapes.
Return the list of inheritance connectors between the passed in entity - type = shape and its derived or base entity - type - shapes .
internal static IEnumerable<InheritanceConnector> GetListOfInheritanceConnectorsForEntityTypeShape(EntityTypeShape entityTypeShape)
        {
            var inheritanceConnectors = new HashSet<InheritanceConnector>();
            if (entityTypeShape == null)
            {
                Debug.Fail("argument entityTypeShape must not be null");
                return inheritanceConnectors;
            }
            if (entityTypeShape.EntityType.SafeTarget == null)
            {
                Debug.Fail("argument entityTypeShape must reference an entity type.");
                return inheritanceConnectors;
            }
            var conceptualEntityType = entityTypeShape.EntityType.SafeTarget as ConceptualEntityType;
            Debug.Assert(conceptualEntityType != null, "entityTypeShape.EntityType.SafeTarget should be a ConceptualEntityType");
            if (conceptualEntityType != null)
            {
                var ic =
                    conceptualEntityType.GetAntiDependenciesOfType<InheritanceConnector>()
                        .Where(c => c.Diagram.Id == entityTypeShape.Diagram.Id)
                        .FirstOrDefault();
                if (ic != null)
                {
                    inheritanceConnectors.Add(ic);
                }
                foreach (var derivedEntityType in conceptualEntityType.ResolvableDirectDerivedTypes)
                {
                    ic =
                        derivedEntityType.GetAntiDependenciesOfType<InheritanceConnector>()
                            .Where(c => c.Diagram.Id == entityTypeShape.Diagram.Id)
                            .FirstOrDefault();
                    if (ic != null
                        && inheritanceConnectors.Contains(ic) == false)
                    {
                        inheritanceConnectors.Add(ic);
                    }
                }
            }
            return inheritanceConnectors;
        }
internal static IEnumerable < InheritanceConnector > GetListOfInheritanceConnectorsForEntityTypeShape ( EntityTypeShape entityTypeShape ) { var inheritanceConnectors = new HashSet < InheritanceConnector > ( ) ; if ( entityTypeShape == null ) { Debug . Fail ( " " ) ; return inheritanceConnectors ; } if ( entityTypeShape . EntityType . SafeTarget == null ) { Debug . Fail ( " " ) ; return inheritanceConnectors ; } var conceptualEntityType = entityTypeShape . EntityType . SafeTarget as ConceptualEntityType ; Debug . Assert ( conceptualEntityType != null , " " ) ; if ( conceptualEntityType != null ) { var ic = conceptualEntityType . GetAntiDependenciesOfType < InheritanceConnector > ( ) . Where ( c => c . Diagram . Id == entityTypeShape . Diagram . Id ) . FirstOrDefault ( ) ; if ( ic != null ) { inheritanceConnectors . Add ( ic ) ; } foreach ( var derivedEntityType in conceptualEntityType . ResolvableDirectDerivedTypes ) { ic = derivedEntityType . GetAntiDependenciesOfType < InheritanceConnector > ( ) . Where ( c => c . Diagram . Id == entityTypeShape . Diagram . Id ) . FirstOrDefault ( ) ; if ( ic != null && inheritanceConnectors . Contains ( ic ) == false ) { inheritanceConnectors . Add ( ic ) ; } } } return inheritanceConnectors ; }
Return the list of inheritance connectors between the passed in entity-type=shape and its derived or base entity-type-shapes.
Return the list of inheritance connectors between the passed in entity - type = shape and its derived or base entity - type - shapes .
// Add inheritance connector to the base type in the diagram. // Add inheritance connector to the derived type in the diagram.
None
entityTypeShape
EntityTypeShape
None