Monday, March 14, 2016

Convert Json string to C# object



MapPolicySnapshop snap = JsonConvert.DeserializeObject<MapPolicySnapshot>(responseString);
using Newtonsoft.Json;
String To Object
public T StringToObject<T>(string json){
 return JsonConvert.DeserializeObject<T>(responseString);
}

obj
public string ObjectToString(T obj){
   return JsonConvert.DeserializeObject<T>(obj);
}

No comments:

Post a Comment

Sql server row level policy