Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8701933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:31:24+00:00 2026-06-13T02:31:24+00:00

I have service that will receive some data in ‘json’, i don’t know which

  • 0

I have service that will receive some data in ‘json’, i don’t know which data. However I have set of attributes that might be there.
the Json format is something like this and can’t be changed, names could be different:

{"Parent1":
     {"Child1":"Value1","Child2":"Value2"},
 "Parent2":
     {"Child1":"Value1","Child2":"Value2"},
 "Parent3":
     {"Child1":
          {"SubChild1":"Value1","SubChild2":"Value2"}}
}

I want to enumerate through all items to be able get key:value pairs.
Please note that hierarchy is important as several objects could have the same key but different parent.
Also please note that I don’t know keys, i need to get keys as well as values, so I can’t get a POCO object out of this straight away.

So the question basically is: how to get a collection that would implement some iterator through all the properties (with accessor to both key and value) and would support hierarchy.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:31:26+00:00Added an answer on June 13, 2026 at 2:31 am

    You can always deserialize the JSON input into some (untyped) DOM where you can traverse the tree which represents the JSON document. There are a couple of options: the JavaScriptSerializer class, which will deserialize that JSON into a Dictionary<string, object> (for arrays it would deserialize into an object[]). Or you can use a third-party library, such as JSON.NET, which you can deserialize arbitrary JSON into a JToken/JObject/JArray/JValue tree, and traverse it using the methods from those classes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a service that will return 0 or more sets of data. The
Hi I have an web service based app that will interchange data with our
im writting a twitter mashup service. When i receive the json data, some of
I need to have ALWAYS a background service that will synchronize my Android application
Here is what I have in mind: 1) Create a service that will run
I'm manually creating a WCF service that will act as a DAL and have
We will develop a web site that will have some free services and we
I'm trying to make a WCF service that will work with JSON-P (long-story short,
I've got a WCF service that will need to receive client credentials, and maintain
I have an issue with javascript/jQuery...I have a web service that will process information

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.