src/Misc/EFTools/EntityDesignModel/ModelHelper.cs
/// <summary>
///     Checks if there exists a circular loop in the Complex Type definition
/// </summary>
/// <param name="complexType"></param>
/// <returns>True if there is a cycle that includes passed ComplexType</returns>
Checks if there exists a circular loop in the Complex Type definition
Checks if there exists a circular loop in the Complex Type definition
internal static bool ContainsCircularComplexTypeDefinition(ComplexType complexType)
        {
            var visited = new HashSet<ComplexType>();
            foreach (var property in complexType.Properties())
            {
                var complexProperty = property as ComplexConceptualProperty;
                if (complexProperty != null
                    && complexProperty.ComplexType.Status == BindingStatus.Known)
                {
                    if (ContainsCircularComplexTypeDefinition(complexType, complexProperty.ComplexType.Target, visited))
                    {
                        return true;
                    }
                }
            }
            return false;
        }
internal static bool ContainsCircularComplexTypeDefinition ( ComplexType complexType ) { var visited = new HashSet < ComplexType > ( ) ; foreach ( var property in complexType . Properties ( ) ) { var complexProperty = property as ComplexConceptualProperty ; if ( complexProperty != null && complexProperty . ComplexType . Status == BindingStatus . Known ) { if ( ContainsCircularComplexTypeDefinition ( complexType , complexProperty . ComplexType . Target , visited ) ) { return true ; } } } return false ; }
Checks if there exists a circular loop in the Complex Type definition
Checks if there exists a circular loop in the Complex Type definition
True if there is a cycle that includes passed ComplexType
True if there is a cycle that includes passed ComplexType
complexType
ComplexType
None