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

NeedsHandleCascadeDeleteMethod() public method

True if this entity type requires the HandleCascadeDelete method defined and the method has not been defined on any base type
public NeedsHandleCascadeDeleteMethod ( ItemCollection itemCollection, EntityType entity ) : bool
itemCollection ItemCollection
entity System.Data.Metadata.Edm.EntityType
return bool
        public bool NeedsHandleCascadeDeleteMethod(ItemCollection itemCollection, EntityType entity)
        {
            bool needsMethod = ContainsCascadeDeleteAssociation(itemCollection, entity);
            // Check to make sure no base types have already declared this method
            EntityType baseType = entity.BaseType as EntityType;
            while (needsMethod && baseType != null)
            {
                needsMethod = !ContainsCascadeDeleteAssociation(itemCollection, baseType);
                baseType = baseType.BaseType as EntityType;
            }
            return needsMethod;
        }