TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Neethu pradeep
NA
36
10.6k
Parsing of nested JSON array
Nov 22 2018 12:40 AM
have a json array contains object which is details of countries and each country details include "language" array which is contains objects and each contais 'name" and other language detais(List of Language). how to parse this nested json array using c#.
Uri page = new Uri("https://restcountries.eu/rest/v2/all");
HttpClient client = new HttpClient();
string response = await client.GetStringAsync(page);
JArray objectArray = (JArray)JsonConvert.DeserializeObject(response);
foreach (JObject jobject in objectArray)
{
WorkItem.Add(new WorkItem()
{
Country = (jobject["name"].ToString()),
Capital = (jobject["capital"].ToString()),
Imag = (jobject["flag"].ToString()),
Region = (jobject["region"].ToString()),
S_region = (jobject["subregion"].ToString()),
Population = (int)(jobject["population"]),
Area = (double?)(jobject["area"])
});
}
Now how can i add list of languages on this WorkItem collection of each object of WorkItem calss
(on visual studio 2015, for window phone 8.1)
Reply
Answers (
1
)
XAMARIN ANDROID C# EXPORT SMS TO CSV
What’s the correct image format for the android application