通过查询从数据库获得json 数据
json 转换为 .net 对象
JPushModel model = new JPushModel();
JObject objt = (JObject)JsonConvert.DeserializeObject(row["NotificationContent"].ToString());
model.NotificationContent = objt;
public class JPushModel
{
//发送内容 json数据
public Newtonsoft.Json.Linq.JObject NotificationContent { get; set; }
public string JpushType { get; set; }
}
从json对象中取出子对象的值
var Json= Newtonsoft.Json.Linq.JObject.Parse(Sjson);
string JpushType= Json["子对象名"].ToString();