Esempio n. 1
0
        public static void Printf <T>(FluentExpressionSQLCore <T> expression2Sql, string description = "")
        {
            // string sql = expression2Sql.ToSqlString();

            string comment = "--";

            if (!string.IsNullOrWhiteSpace(description))
            {
                Print(comment + description);
            }
            if (ExpressionSqlBuilder.ExistSubQuery())
            {
                foreach (KeyValuePair <string, object> item in ExpressionSqlBuilder.GetExistDbParameters())
                {
                    Print(comment + item.ToString() + " --- " + item.Value.GetType());
                }
            }
            //Console.WriteLine(expression2Sql.RawString);
            Print("-------------------参数----------------------------");
            foreach (KeyValuePair <string, object> item in expression2Sql.DbParams)
            {
                Print(comment + item.ToString() + " --- " + item.Value.GetType());
            }

            Print("-------------------SQL----------------------------");

            Print(expression2Sql.RawString);

            Print("-------------------RawSQL----------------------------");
            Print(expression2Sql.ToSqlString());
            Console.WriteLine();
            Console.WriteLine();
        }