src/Shared/EntityFramework/Core/Mapping/Update/Internal/KeyManager.cs
// <summary>
// Checks whether there is a cycle in the identifier graph.
// </summary>
Checks whether there is a cycle in the identifier graph.
Checks whether there is a cycle in the identifier graph .
internal void ValidateReferentialIntegrityGraphAcyclic()
        {
            var color = new NodeColor[_identifiers.Count];
            for (int i = 0, n = _identifiers.Count; i < n; i++)
            {
                if (color[i] == White)
                {
                    ValidateReferentialIntegrityGraphAcyclic(i, color, null);
                }
            }
        }
internal void ValidateReferentialIntegrityGraphAcyclic ( ) { var color = new NodeColor [ _identifiers . Count ] ; for ( int i = 0 , n = _identifiers . Count ; i < n ; i ++ ) { if ( color [ i ] == White ) { ValidateReferentialIntegrityGraphAcyclic ( i , color , null ) ; } } }
Checks whether there is a cycle in the identifier graph.
Checks whether there is a cycle in the identifier graph .
// _identifierRefConstraints describes the referential integrity // 'identifier' graph. How is a conflict // even possible? The state manager does not enforce integrity // constraints but rather forces them to be satisfied. In other words, // the dependent entity takes the value of its parent. If a parent // is also a child however, there is no way of determining which one // controls the value. // Standard DFS search // Color nodes as we traverse the graph: White means we have not // explored a node yet, Gray means we are currently visiting a node, and Black means // we have finished visiting a node.