src/NetStandard/EntityFrameworkCore/Query/src/CollectionConstantPredicateBuilder{SourceType,ComparisonType}.cs
/// <summary>
/// Gets called on construction of the very first collection and manually on every further collection.
/// </summary>
/// <param name="comparisonItemEnumerator"></param>
/// <param name="comparisonItemEnumeratorMovedToFirst"></param>
/// <param name="sourceAndComparisonItemPredicate"></param>
/// <param name="sourceParameterExpression"></param>
/// <param name="sourceParameterReplacement"></param>
Gets called on construction of the very first collection and manually on every further collection.
Gets called on construction of the very first collection and manually on every further collection .
private void onConstruction(
            IEnumerator<ComparisonItemType> comparisonItemEnumerator, 
            bool comparisonItemEnumeratorMovedToFirst,
            Expression<SourceInConstantPredicateDelegate<SourceType, ComparisonItemType>> sourceAndComparisonItemPredicate,
            out ParameterExpression sourceParameterExpression, ParameterExpression? sourceParameterReplacement)
        {
            cachedComparisonItemAndPredicateList = new List<ComparisonItemAndPredicate>();
            sourceParameterExpression = null!;
            Dictionary<int, ParameterExpression>? positionalParameterReplacements;
            if (sourceParameterReplacement is null) {
                positionalParameterReplacements = null;
            } else {
                positionalParameterReplacements = new Dictionary<int, ParameterExpression>() { { 0, sourceParameterReplacement } };
            }
            while (comparisonItemEnumeratorMovedToFirst || comparisonItemEnumerator.MoveNext()) {
                comparisonItemEnumeratorMovedToFirst = false;
                var comparisonItem = comparisonItemEnumerator.Current;
                var whereInConstantExpression = SourceTargetExpressionTools.ReplaceParameterByConstantLambdaBody(
                    sourceAndComparisonItemPredicate,
                    positionalParameterReplacements,
                    new Dictionary<int, object?>() { { 1, comparisonItem } },
                    out var positionalParameters);
                sourceParameterExpression = positionalParameters[0];
                var comparisonItemAndPredicate = new ComparisonItemAndPredicate(comparisonItem, whereInConstantExpression);
                cachedComparisonItemAndPredicateList.Add(comparisonItemAndPredicate);
            }
        }
private void onConstruction ( IEnumerator < ComparisonItemType > comparisonItemEnumerator , bool comparisonItemEnumeratorMovedToFirst , Expression < SourceInConstantPredicateDelegate < SourceType , ComparisonItemType > > sourceAndComparisonItemPredicate , out ParameterExpression sourceParameterExpression , ParameterExpression ? sourceParameterReplacement ) { cachedComparisonItemAndPredicateList = new List < ComparisonItemAndPredicate > ( ) ; sourceParameterExpression = null ! ; Dictionary < int , ParameterExpression > ? positionalParameterReplacements ; if ( sourceParameterReplacement is null ) { positionalParameterReplacements = null ; } else { positionalParameterReplacements = new Dictionary < int , ParameterExpression > ( ) { { 0 , sourceParameterReplacement } } ; } while ( comparisonItemEnumeratorMovedToFirst || comparisonItemEnumerator . MoveNext ( ) ) { comparisonItemEnumeratorMovedToFirst = false ; var comparisonItem = comparisonItemEnumerator . Current ; var whereInConstantExpression = SourceTargetExpressionTools . ReplaceParameterByConstantLambdaBody ( sourceAndComparisonItemPredicate , positionalParameterReplacements , new Dictionary < int , object ? > ( ) { { 1 , comparisonItem } } , out var positionalParameters ) ; sourceParameterExpression = positionalParameters [ 0 ] ; var comparisonItemAndPredicate = new ComparisonItemAndPredicate ( comparisonItem , whereInConstantExpression ) ; cachedComparisonItemAndPredicateList . Add ( comparisonItemAndPredicate ) ; } }
Gets called on construction of the very first collection and manually on every further collection.
Gets called on construction of the very first collection and manually on every further collection .
//var whereInConstantExpression = SourceTargetExpressionTools.ReplaceParameterByConstantLambdaBody(comparisonItem, sourceAndComparisonItemPredicate, //    out sourceParameterExpression, sourceParameterReplacement: sourceParameterReplacement);
comparisonItemEnumerator
IEnumerator<ComparisonItemType>
None
comparisonItemEnumeratorMovedToFirst
bool
None
sourceAndComparisonItemPredicate
Expression<SourceInConstantPredicateDelegate<SourceType, ComparisonItemType>>
None
ParameterExpression
out
sourceParameterReplacement
ParameterExpression?
None
sourceParameterExpression
None