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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:13:50+00:00 2026-05-20T11:13:50+00:00

I want to deserialize a JSON string which does not necessarily contain data for

  • 0

I want to deserialize a JSON string which does not necessarily contain data for every member, e.g:

public class MyStructure
{
   public string Field1;
   public string Field2;
}

Suppose I have an instance:

Field1: "data1"
Field2: "data2"

and I deserialize a string:

{ "Field1": "newdata1" }

The result should be

Field1: "newdata1"
Field2: "data2"

Framework JavascriptSerializer and JSON.NET both return new objects in their deserialize methods, so the only way I can think of doing this directly would be to compare the deserialized object with the existing one using reflection which seems like a lot of unnecessary overhead. Ideally, some software would have a method in which I passed an existing instance of an object, and only those members which existed in the string would get updated. The point here is that I would like to be able to pass only data which has changed to the server, and update an existing object.

Is this possible using either of these tools, and if not, any suggestions on how to approach the problem?

  • 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-20T11:13:51+00:00Added an answer on May 20, 2026 at 11:13 am

    After poking around the source code (so much easier than reading the documentation, eh?) JSON.NET does exactly what I want already:

    JsonConvert.PopulateObject(string, object)

    See Json.NET: Populate an Object

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

Sidebar

Related Questions

I have about 7000 lines of JSON data that I want to parse. An
I am using c#. Now I am looking to create a JSONHelper class, which
I'd like to be able to parse a string of JSON representing an object
I am using xstream to de/serialize objects to json. I want to serialize a
I have a file named config.json. Here's its contents: { dataSources: [ http://www.blahblah.com/blah, http://www.blahblah.com/blah2,
I see a lot of simple examples of JSON DeSerialization, but when it comes
I am running a Jersey REST service. The POJO's which represent my resources are
We've got a Python-based web server that unpickles a number of large data files
.NET provides the JavaScriptSerializer class in the System.Web.Script.Serialization namespace. (provided in System.Web.Extensions.dll) It was
I'm working on a simple web application with Scala. The plan is to obtain

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.