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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:19:22+00:00 2026-06-11T15:19:22+00:00

I’m getting a error when converting JSON to an object. I can get the

  • 0

I’m getting a error when converting JSON to an object. I can get the JSON thru Fiddler, so there is nothing wrong with my Web API I guess.

This is the error that I have:

{“Cannot deserialize the current JSON object (e.g. {\”name\”:\”value\”}) into type ‘System.Collections.Generic.List`1[MvcMobile.WebAPI.Model.Person]’ because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.\r\nTo fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.\r\nPath ‘BusinessEntityID’, line 1, position 30.”}

This is the JSON:

{"$id":"1", "BusinessEntityID":1,"PersonType":"EM","NameStyle":false,"Title":null,
"FirstName":"Ken", "MiddleName":"J","LastName":"Sánchez","Suffix":null,
"EmailPromotion":0,"AdditionalContactInfo":null,"Demographics":"0",
"rowguid":"92c4279f-1207-48a3-8448-4636514eb7e2",
"ModifiedDate":"2003-02-    08T00:00:00","Employee":null}

And this is the code:

HttpResponseMessage resp = client.GetAsync("http://localhost:8080/api/person/GetPerson/" + id).Result;
resp.EnsureSuccessStatusCode();

var result = resp.Content.ReadAsAsync<IEnumerable<Person>>().Result;

In Entity Framework I have set the following two options:

this.Configuration.LazyLoadingEnabled = false; 
this.Configuration.ProxyCreationEnabled = false;

Could it be because I only get back one entity that JSON has a problem with that? Or something with missing []{}? Or mabye their is a better way to go from JSON to an object?

  • 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-11T15:19:23+00:00Added an answer on June 11, 2026 at 3:19 pm

    I changed code to and it worked out for me.

    var result = resp.Content.ReadAsAsync<Person>().Result;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While using the Rotten Tomatoes API I am getting the following error: org.json.JSONException: Value
Please help me why i'm getting this error. I'm getting Json response converting into
I am getting an error in converting string to date in C#. The error
I am getting the error Conversion failed when converting date and/or time from character
I'm gettin the followig error after converting JSON echo into a dictionary, * Terminating
I am getting the following error in my code. Error converting data type nvarchar
Hello I am getting this error - 'Error converting data type nvarchar to bigint'
I'm getting this error: Can't mass-assign protected attributes: quantities I looked up all the
I'm trying to stringify(...) an object in Chrome, and I keep getting a Converting
I've been getting the error Conversion failed when converting from a character string to

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.