src/Misc/EFTools/EntityDesignModel/Integrity/InferReferentialContraints.cs
/// <summary>
///     This method infers constraints for all associations that use this entity type.
/// </summary>
/// <param name="cpc"></param>
/// <param name="entityType">This is only valid for C-Side entities.</param>
This method infers constraints for all associations that use this entity type.
This method infers constraints for all associations that use this entity type .
internal static void AddRule(CommandProcessorContext cpc, EntityType entityType)
        {
            Debug.Assert(entityType != null, "entityType should not be null");
            Debug.Assert(entityType.EntityModel.IsCSDL, "entityType should be from C-side");
            var processedAssociations = new HashSet<Association>();
            foreach (var end in entityType.GetAntiDependenciesOfType<AssociationEnd>())
            {
                var association = end.Parent as Association;
                Debug.Assert(association != null, "end.Parent should be an Association");
                if (association != null)
                {
                    if (processedAssociations.Contains(association) == false)
                    {
                        AddRule(cpc, association);
                        processedAssociations.Add(association);
                    }
                }
            }
        }
internal static void AddRule ( CommandProcessorContext cpc , EntityType entityType ) { Debug . Assert ( entityType != null , " " ) ; Debug . Assert ( entityType . EntityModel . IsCSDL , " " ) ; var processedAssociations = new HashSet < Association > ( ) ; foreach ( var end in entityType . GetAntiDependenciesOfType < AssociationEnd > ( ) ) { var association = end . Parent as Association ; Debug . Assert ( association != null , " " ) ; if ( association != null ) { if ( processedAssociations . Contains ( association ) == false ) { AddRule ( cpc , association ) ; processedAssociations . Add ( association ) ; } } } }
This method infers constraints for all associations that use this entity type.
This method infers constraints for all associations that use this entity type .
cpc
CommandProcessorContext
None
entityType
EntityType
This is only valid for C-Side entities.
This is only valid for C - Side entities .