src/Shared/EntityFramework/Core/Mapping/Update/Internal/Propagator.JoinPropagator.JoinPredicateVisitor.cs
// <summary>
// Determine properties from the left and right inputs to an equi-join participating
// in predicate.
// </summary>
// <remarks>
// The property definitions returned are 'aligned'. If the join predicate reads:
// <code>a = b AND c = d AND e = f</code>
// then the output is as follows:
// <code>leftProperties = {a, c, e}
//     rightProperties = {b, d, f}</code>
// See Walker class for an explanation of this coding pattern.
// </remarks>
Determine properties from the left and right inputs to an equi-join participating
in predicate.
Determine properties from the left and right inputs to an equi - join participating in predicate .
internal static void GetKeySelectors(
                    DbExpression joinCondition, out ReadOnlyCollection<DbExpression> leftKeySelectors,
                    out ReadOnlyCollection<DbExpression> rightKeySelectors)
                {
                    DebugCheck.NotNull(joinCondition);
                    var visitor = new JoinConditionVisitor();
                    joinCondition.Accept(visitor);
                    leftKeySelectors = new ReadOnlyCollection<DbExpression>(visitor.m_leftKeySelectors);
                    rightKeySelectors = new ReadOnlyCollection<DbExpression>(visitor.m_rightKeySelectors);
                    Debug.Assert(
                        leftKeySelectors.Count == rightKeySelectors.Count,
                        "(Update/JoinPropagator) The equi-join must have an equal number of left and right properties");
                }
internal static void GetKeySelectors ( DbExpression joinCondition , out ReadOnlyCollection < DbExpression > leftKeySelectors , out ReadOnlyCollection < DbExpression > rightKeySelectors ) { DebugCheck . NotNull ( joinCondition ) ; var visitor = new JoinConditionVisitor ( ) ; joinCondition . Accept ( visitor ) ; leftKeySelectors = new ReadOnlyCollection < DbExpression > ( visitor . m_leftKeySelectors ) ; rightKeySelectors = new ReadOnlyCollection < DbExpression > ( visitor . m_rightKeySelectors ) ; Debug . Assert ( leftKeySelectors . Count == rightKeySelectors . Count , " " ) ; }
Determine properties from the left and right inputs to an equi-join participating
in predicate.
Determine properties from the left and right inputs to an equi - join participating in predicate .
// Constructs a new predicate visitor, which implements a visitor for expression nodes // and returns no values. This visitor instead builds up a list of properties as leaves // of the join predicate are visited. // Walk the predicate using the predicate visitor. // Retrieve properties discovered visiting predicate leaf nodes.
joinCondition
DbExpression
ReadOnlyCollection<DbExpression>
out
remarks
The property definitions returned are 'aligned'. If the join predicate reads:
a = b AND c = d AND e = fleftProperties = {a, c, e}
rightProperties = {b, d, f}
The property definitions returned are ' aligned ' . If the join predicate reads : a = b AND c = d AND e = fleftProperties = { a c e } rightProperties = { b d f }