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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:17:44+00:00 2026-06-04T18:17:44+00:00

I am trying to Deserialize (using Newtonsoft) JSON and convert to List in c#.

  • 0

I am trying to Deserialize (using Newtonsoft) JSON and convert to List in c#. It is throwing me error ” Cannot deserialize JSON object into type ‘System.Collections.Generic.List`1[obJson]’.”

Here is my JSON string:

  string webContent = "{\"searchResults\":     [{\"gefId\":0,\"resultNumber\":1,\"distance\":4.2839,\"sourceName\":\"MQA.MQ_34172_HD\",\"name\":\"USER_DEFINED\"},{\"gefId\":0,\"resultNumber\":1,\"distance\":4.2839,\"sourceName\":\"MQA.MQ_34172_HD\",\"name\":\"USER_DEFINED\"}]}";

Conversion, this line is throwing error:

  List<obJson> result = JsonConvert.DeserializeObject<List<obJson>>(webContent);

My custom classes:

public class SearchResults
{
    public int gefId { get; set; }
    public int resultNumber { get; set; }
    public decimal distance { get; set; }
    public string sourceName { get; set; }
    public string name { get; set; }
}

public class obJson
{
    public SearchResults SearchResults { get; set; }
}
  • 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-04T18:17:46+00:00Added an answer on June 4, 2026 at 6:17 pm

    Since your json is an object whose searchResults member contains an array, change your obJson as below

    public class obJson
    {
        public List<SearchResults> searchResults { get; set; }
    }
    

    and deserialize as

    obJson result = JsonConvert.DeserializeObject<obJson>(webContent);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to deserialize a json string into a new list on C# using
I am trying to deserialize/map the below JSON to List<Bill > java object using
I'm trying to deserialize json to an object model where the collections are represented
I am trying to deserialize a JSON string using VB.net and cannot seem to
Using DCS I am trying to deserialize objects from XML where the object serialized
I am trying to serialize/deserialize JSON in Android using GSON. I have two classes
i'm trying to deserialize a json string pulled from the web using json.net, but
I'm trying to deserialize a parameter being passed into a web service call using
I am trying to use eval() function to deserialize this JSON text by using
I'm using the Newtonsoft JSON.NET package to deserialize my responses. This is a sample

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.