src/Shared/EntityFramework/Core/Mapping/Update/Internal/KeyManager.cs
// <summary>
// Indicate that the principal identifier controls the value for the dependent identifier.
// </summary>
Indicate that the principal identifier controls the value for the dependent identifier.
Indicate that the principal identifier controls the value for the dependent identifier .
internal void AddReferentialConstraint(IEntityStateEntry dependentStateEntry, int dependentIdentifier, int principalIdentifier)
        {
            var dependentInfo = _identifiers[dependentIdentifier];
            if (dependentIdentifier != principalIdentifier)
            {
                AssociateNodes(dependentIdentifier, principalIdentifier);
                LinkedList<int>.Add(ref dependentInfo.References, principalIdentifier);
                var principalInfo = _identifiers[principalIdentifier];
                LinkedList<int>.Add(ref principalInfo.ReferencedBy, dependentIdentifier);
            }
            LinkedList<IEntityStateEntry>.Add(ref dependentInfo.DependentStateEntries, dependentStateEntry);
        }
internal void AddReferentialConstraint ( IEntityStateEntry dependentStateEntry , int dependentIdentifier , int principalIdentifier ) { var dependentInfo = _identifiers [ dependentIdentifier ] ; if ( dependentIdentifier != principalIdentifier ) { AssociateNodes ( dependentIdentifier , principalIdentifier ) ; LinkedList < int > . Add ( ref dependentInfo . References , principalIdentifier ) ; var principalInfo = _identifiers [ principalIdentifier ] ; LinkedList < int > . Add ( ref principalInfo . ReferencedBy , dependentIdentifier ) ; } LinkedList < IEntityStateEntry > . Add ( ref dependentInfo . DependentStateEntries , dependentStateEntry ) ; }
Indicate that the principal identifier controls the value for the dependent identifier.
Indicate that the principal identifier controls the value for the dependent identifier .
// A value is trivially constrained to be itself // track these as 'equivalent values'; used to determine canonical identifier for dependency // ordering and validation of constraints // remember the constraint
dependentStateEntry
IEntityStateEntry
dependentIdentifier
int
principalIdentifier
int