public string Translate(DbExpression expression, out List <DbParam> parameters)
        {
            SqlGenerator generator = MySqlSqlGenerator.CreateInstance();

            expression = EvaluableDbExpressionTransformer.Transform(expression);
            expression.Accept(generator);

            parameters = generator.Parameters;
            string sql = generator.SqlBuilder.ToSql();

            return(sql);
        }
Example #2
0
        public DbCommandInfo Translate(DbExpression expression)
        {
            SqlGenerator generator = MySqlSqlGenerator.CreateInstance();

            expression = EvaluableDbExpressionTransformer.Transform(expression);
            expression.Accept(generator);

            DbCommandInfo dbCommandInfo = new DbCommandInfo();

            dbCommandInfo.Parameters  = generator.Parameters;
            dbCommandInfo.CommandText = generator.SqlBuilder.ToSql();

            return(dbCommandInfo);
        }