Hi all,
I have a List
I add an object that contains Json data to this list in a foreach loop: posts.Add(statusJson);
Now this Json object (statusJson) contains these fields : name,message and created_time. I would like to sort the list by created_time
Any suggestions?
Avuya MxoliPosted Jan 17, 2014, 4:56 AM
[{"Data":[{"from":{"name":"someone","id":"},"message":"something","created_time":"some date"},{"from":{"name":"someone","id":"},"message":"something","created_time":"some date"}
and so on and so on...
Jignesh TrivediPosted Jan 17, 2014, 4:33 AM
I am not able to find attachment.
Can you please share json string like
string a = = "{\"Id\":\"1\",\"Name\":\"Jignesh\"}"
Avuya MxoliPosted Jan 17, 2014, 4:02 AM
Jignesh TrivediPosted Jan 17, 2014, 3:59 AM
can you please share your json data format. how it look?
Avuya MxoliPosted Jan 17, 2014, 3:39 AM
Jignesh TrivediPosted Jan 17, 2014, 3:32 AM
are you required json data with in your application?
if no than de-serialize it in to class and sort it.
hope this will help you.
Avuya MxoliPosted Jan 17, 2014, 3:14 AM
Jignesh TrivediPosted Jan 17, 2014, 2:55 AM
hi,
why you require json object here?
Instead of Json object you can use class object which has similar property.
if you have class object than you can easily sort this..
hope this will help you.
Avuya MxoliPosted Jan 17, 2014, 2:50 AM
then: posts.Add(statusJson);
All in the foreach. So your suggestion will not work,maybe you can suggest how I can do it on the client side(javascript) because at least there I can access the individual values of my json object. Thanks again
Abhishek GoswamiPosted Jan 17, 2014, 2:27 AM