EFUtility.CodeGenerationTools.MetadataTools.ContainsCascadeDeleteAssociation C# (CSharp) Method

ContainsCascadeDeleteAssociation() private method

True if this entity type participates in any relationships where the other end has an OnDelete cascade delete defined, or if it is the dependent in any identifying relationships
private ContainsCascadeDeleteAssociation ( ItemCollection itemCollection, EntityType entity ) : bool
itemCollection ItemCollection
entity System.Data.Metadata.Edm.EntityType
return bool
        private bool ContainsCascadeDeleteAssociation(ItemCollection itemCollection, EntityType entity)
        {
            return itemCollection.GetItems<AssociationType>().Where(a =>
                    ((RefType)a.AssociationEndMembers[0].TypeUsage.EdmType).ElementType == entity && IsCascadeDeletePrincipal(a.AssociationEndMembers[1]) ||
                    ((RefType)a.AssociationEndMembers[1].TypeUsage.EdmType).ElementType == entity && IsCascadeDeletePrincipal(a.AssociationEndMembers[0])).Any();
        }