src/Misc/EFTools/EntityDesignEntityDesigner/CustomCode/DomainClasses/EntityTypeBase.cs
/// <summary>
///     Detects if this entity has a circular inheritance
/// </summary>
/// <param name="circularPathFound"></param>
/// <returns></returns>
Detects if this entity has a circular inheritance
Detects if this entity has a circular inheritance
internal bool HasCircularInheritance(out string circularPathFound)
        {
            var hasCircularInheritance = false;
            var visited = new Dictionary<EntityTypeBase, int>();
            visited.Add(this, 0);
            var circularPath = Name;
            circularPathFound = circularPath;
            var baseType = BaseType;
            while (baseType != null)
            {
                circularPath += " -> " + baseType.Name;
                if (visited.ContainsKey(baseType))
                {
                    circularPathFound = circularPath;
                    hasCircularInheritance = true;
                    break;
                }
                visited.Add(baseType, 0);
                baseType = baseType.BaseType;
            }
            return hasCircularInheritance;
        }
internal bool HasCircularInheritance ( out string circularPathFound ) { var hasCircularInheritance = false ; var visited = new Dictionary < EntityTypeBase , int > ( ) ; visited . Add ( this , 0 ) ; var circularPath = Name ; circularPathFound = circularPath ; var baseType = BaseType ; while ( baseType != null ) { circularPath += " " + baseType . Name ; if ( visited . ContainsKey ( baseType ) ) { circularPathFound = circularPath ; hasCircularInheritance = true ; break ; } visited . Add ( baseType , 0 ) ; baseType = baseType . BaseType ; } return hasCircularInheritance ; }
Detects if this entity has a circular inheritance
Detects if this entity has a circular inheritance
None
string
out
circularPathFound
None