C# Json 转 Model / Model 转 Json

Json 转 Model

 

引用  using Newtonsoft.Json;

T Model= JsonConvert.DeserializeObject<T> (JsonString );

 

 

Model 转 Json 

引用 using System.Web.Script.Serialization;

JavaScriptSerializer serializer = new JavaScriptSerializer();

var JsonString =serializer.Serialize(Model)

相关文章