コード例 #1
0
        private void HandleParameter(MethodCallExpression node)
        {
            if (node.HasParameterArgument())
            {
                if (containsNames.Contains(node.Method.Name))
                {
                    HandleContains(node);
                    return;
                }


                if (node.Method.Name == "InjectSql")
                {
                    HandleInject(node);
                    return;
                }

                _sb.Append(_provider.GetSql(node, new ExpressionSqlGenerator(_provider, _factory, _escape, Parameters)));
                return;
            }

            if (node.BelongsToParameter() && node.Object.Type.Is <string>())
            {
                HandleParamStringFunctions(node);
            }
        }
コード例 #2
0
 public ExpressionSqlGeneratorTests()
 {
     _provider.GetSql(Arg.Any <MethodCallExpression>(), Arg.Any <IGenerateSqlFromExpressions>())
     .Returns(x => TestDbProviderExpression.Instance.GetSql(x.ArgAt <MethodCallExpression>(0), x.ArgAt <IGenerateSqlFromExpressions>(1)));
     _sut = Setup.CreateExpressionSqlGenerator(_provider);
 }