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;
}