Nice extension method if you work allot with ajax/javascript/linq.
public static string ToJson(this object o)
{
return (JsonConvert.SerializeObject(o));
}
Can call from code.
example:
[WebMethod]
public string GetAllPoultry(){
var q = from b in data.Chicken select b;
return q.ToJson();
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment