C# 中 DapperRow 数据解析

                            using Newtonsoft.Json;

                             List<DataColumnModel> lstColumn = new List<DataColumnModel>()
                            {
                                new DataColumnModel { ColumnName = "Name", ColumnCaption = "部门名称", ColumnType = typeof(string) },
                                new DataColumnModel { ColumnName = "Value", ColumnCaption = "小计", ColumnType = typeof(int) }
                            };
                        string json = JsonConvert.SerializeObject(data.rows); 
                        JArray jArray = (JArray)JsonConvert.DeserializeObject(json);
                        JToken jObj = (JToken)jArray[0];

                        foreach (JProperty jp in jObj)
                        {
                            string name = jp.Name;
                            if (name != "Name" && name != "OrgId" && name != "Value")
                            {
                                DataColumnModel col = new DataColumnModel();
                                col.ColumnName = name;
                                col.ColumnCaption = name;
                                col.ColumnType = typeof(int);
                                lstColumn.Add(col);
                            }
                        }

C# 中 DapperRow 数据解析

上一篇:使用axios对安卓或者ios低版本兼容性处理


下一篇:Android aspectJ Aop