接收参数转 Dictionary

接收数据转Dictionary

 public static dynamic ConvertRequestData(JToken tk)
        {
            var sql = tk.Value<string>("sql");
            var datas = tk.Value<JObject>("datas").Properties().ToDictionary(k => k.Name, k => k.Value.ToObject<object>());
            return new
            {
                sql = sql,
                datas = datas
            } as dynamic;
        }

 

posted @ 2022-03-03 11:20  幽冥狂_七  阅读(54)  评论(0编辑  收藏  举报