Find() 공개 정적인 메소드

public static Find ( Expression expression ) : int
expression System.Linq.Expressions.Expression
리턴 int
예제 #1
0
        internal static Expression Bind(DataAccessModel dataAccessModel, SqlDataTypeProvider sqlDataTypeProvider, Expression expression)
        {
            var placeholderCount = SqlConstantPlaceholderMaxIndexFinder.Find(expression) + 1;

            expression = Evaluator.PartialEval(expression, ref placeholderCount);
            expression = QueryBinder.Bind(dataAccessModel, expression, ref placeholderCount);
            expression = SqlEnumTypeNormalizer.Normalize(expression, sqlDataTypeProvider.GetTypeForEnums());
            expression = Evaluator.PartialEval(expression, ref placeholderCount);
            expression = SqlNullComparisonCoalescer.Coalesce(expression);
            expression = SqlTupleOrAnonymousTypeComparisonExpander.Expand(expression);
            expression = SqlObjectOperandComparisonExpander.Expand(expression);
            expression = SqlRedundantFunctionCallRemover.Remove(expression);

            return(expression);
        }
예제 #2
0
            internal static Expression Eval(HashSet <Expression> candidates, Expression expression, ref int placeholderCount)
            {
                if (candidates.Count == 0)
                {
                    return(expression);
                }

                var i = placeholderCount >= 0 ? placeholderCount : SqlConstantPlaceholderMaxIndexFinder.Find(expression) + 1;

                var evaluator = new SubtreeEvaluator(candidates)
                {
                    index = i
                };

                return(evaluator.Visit(expression));
            }