json转换成实体类

            //将获取到的json格式数据转换成对应的实体类
            JsonSerializer serializer = new JsonSerializer();
            StringReader sr = new StringReader(“json”);
            object o = serializer.Deserialize(new JsonTextReader(sr), typeof(List<DiffDataNoListModel>));
            List<DiffDataNoListModel> listno = o as List<DiffDataNoListModel>;

 

posted @ 2018-12-14 15:14  ly丶乐  阅读(1470)  评论(0编辑  收藏  举报