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 7064021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:47:00+00:00 2026-05-28T04:47:00+00:00

Im trying to parse an JSON response string to my class objects.. I can’t

  • 0

Im trying to parse an JSON response string to my class objects.. I can’t figure this out and i need some help with this.

I use the json.net reference but i cant’t find what i’m looking for 🙁

my json:

{

"@companyName": "Company Name",
"@version": "1.0",
"@generatedDate": "3/1/10 2:10 PM",
"application": [
    {
        "@name": "Application #1 name",
        "@apiKey": "1234",
        "@createdDate": "2010-03-01",
        "@platform": "Platform name"
    },
    {
        "@name": "Application #1 name",
        "@apiKey": "1234",
        "@createdDate": "2010-03-01",
        "@platform": "Platform name"
    }
]
}

my root class for the json is:

public class RootObject
{
    [JsonProperty]
    public string companyName { get; set; }

    [JsonProperty]
    public string version { get; set; }

    [JsonProperty]
    public string generatedDate { get; set; }

    [JsonProperty]
    public List<Application> application { get; set; }
}

my sub class (list of applications):

public class Application
{
    [JsonProperty]
    public string name { get; set; }

    [JsonProperty]
    public string apiKey { get; set; }

    [JsonProperty]
    public string createdDate { get; set; }

    [JsonProperty]
    public string platform { get; set; }
}

To parse it i have the following code now:

      JObject obj = JObject.Parse(e.Result);
      applications = new RootObject
            {
                companyName = (string) obj["companyName"],
                version = (string) obj["version"],
                generatedDate = (string) obj["generatedDate"],
                application = ???????? (how to make a list here?)

            }

Thanks in advance!

  • 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-05-28T04:47:00+00:00Added an answer on May 28, 2026 at 4:47 am

    Change your class definitions as follows

    public class RootObject
    {
        [JsonProperty("@companyName")]
        public string companyName { get; set; }
    
        [JsonProperty("@version")]
        public string version { get; set; }
    
        [JsonProperty("@generatedDate")]
        public string generatedDate { get; set; }
    
        public List<Application> application { get; set; }
    }
    
    public class Application
    {
        [JsonProperty("@name")]
        public string name { get; set; }
    
        [JsonProperty("@apiKey")]
        public string apiKey { get; set; }
    
        [JsonProperty("@createdDate")]
        public string createdDate { get; set; }
    
        [JsonProperty("@platform")]
        public string platform { get; set; }
    }
    

    and deserialize

    var rootObj = JsonConvert.DeserializeObject<RootObject>(myjson);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to parse the JSON response from Wordnik's API. This is built
I am trying to parse a JSON response from a server using javascript/jquery. This
I'm trying to parse some JSON using the JSon.Net library. The documentation seems a
I'm trying to parse an array of JSON objects into an array of strings
Trying to parse some XML but apparently this is too much for a lazy
Trying to parse an SQL string and pull out the parameters. Ex: select *
I am trying to parse some JSON. I've passed a constant key value and
I'm getting really tired of trying to figure out why this code works in
I'm very new to JSON, and I need to parse some that an API
I am trying to parse out data from oodle.com api feed using the JSON.NET

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.