src/Shared/EntityFramework/Core/Query/PlanCompiler/ForeignKeyConstraint.cs
// <summary>
// Build up an equivalence map of primary keys and foreign keys (ie) for each
// foreign key column, identify the corresponding primary key property
// </summary>
Build up an equivalence map of primary keys and foreign keys (ie) for each
foreign key column, identify the corresponding primary key property
Build up an equivalence map of primary keys and foreign keys ( ie ) for each foreign key column identify the corresponding primary key property
[SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters",
            MessageId = "System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler.Assert(System.Boolean,System.String)")]
        private void BuildKeyMap()
        {
            if (m_keyMap != null)
            {
                return;
            }
            m_keyMap = new Dictionary<string, string>();
            IEnumerator<EdmProperty> parentProps = m_constraint.FromProperties.GetEnumerator();
            IEnumerator<EdmProperty> childProps = m_constraint.ToProperties.GetEnumerator();
            while (true)
            {
                var parentOver = !parentProps.MoveNext();
                var childOver = !childProps.MoveNext();
                PlanCompiler.Assert(parentOver == childOver, "key count mismatch");
                if (parentOver)
                {
                    break;
                }
                m_keyMap[childProps.Current.Name] = parentProps.Current.Name;
            }
        }
[ SuppressMessage ( " " , " " , MessageId = " " ) ] private void BuildKeyMap ( ) { if ( m_keyMap != null ) { return ; } m_keyMap = new Dictionary < string , string > ( ) ; IEnumerator < EdmProperty > parentProps = m_constraint . FromProperties . GetEnumerator ( ) ; IEnumerator < EdmProperty > childProps = m_constraint . ToProperties . GetEnumerator ( ) ; while ( true ) { var parentOver = ! parentProps . MoveNext ( ) ; var childOver = ! childProps . MoveNext ( ) ; PlanCompiler . Assert ( parentOver == childOver , " " ) ; if ( parentOver ) { break ; } m_keyMap [ childProps . Current . Name ] = parentProps . Current . Name ; } }
Build up an equivalence map of primary keys and foreign keys (ie) for each
foreign key column, identify the corresponding primary key property
Build up an equivalence map of primary keys and foreign keys ( ie ) for each foreign key column identify the corresponding primary key property