Exemple #1
0
        public JsonResult LoadSql([FromBody] JObject args)
        {
            CallDb callDb = new CallDb();

            string sql = JObject.Parse(args["body"].ToString())["sql"].ToString();
            string arg = Json(JObject.Parse(args["body"].ToString())["args"].ToString()).Value.ToString();

            arg = arg.Replace("\r\n", "").Replace(" ", "");

            JObject json = new JObject();

            if (arg != "[]" && arg != "{}")
            {
                json = JObject.Parse(arg);
            }

            Dictionary <string, object> paramsDic = SettingParams(json);

            string sqlResult = callDb.LoadSql(sql, paramsDic);

            return(Json(sqlResult));
        }