public static string ToJson(this object obj) { var serializer = new JavaScriptSerializer(); return serializer.Serialize(obj); }