I want to count the number of objects from this Response. I dont wnat to make classes for such a small purpose and then iterating over the classes. Is there any shorter way to do that.
I am using both JSON.NET and web.Serialization.
I want to count the number of objects from this Response. I dont wnat to make classes for such a small purpose and then iterating over the classes. Is there any shorter way to do that.
I am using both JSON.NET and web.Serialization.
This would return count of immediate objects in an array.
var input = "[{Name: 'Hello'}, {Name: 'Hi'}]";
dynamic response = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<dynamic>(input);
Response.Write(response.Length);