?
Solved

JSON Deserialization

Posted on 2013-05-24
3
Medium Priority
?
377 Views
Last Modified: 2013-05-24
I have a complex user defined class that contains strings, and int, but also contains other class types, and lists of classes. A simple example is below:

public class Data
{
      public Int32 Id { get; set; }
      public String Name { get; set; }
      public List<Items> Items { get; set; }
}

public class Item
{
      public Int32 Id { get; set; }
      public String Name { get; set; }
}

Open in new window




I have managed to serialize an instance of this class using SimpleJSON.

The problem I have is de-serializing it back to an instance of the original strongly typed class.  

I have spent hours search the web, but cannot find any simple definitive answer.
0
Comment
Question by:townsma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 25

Accepted Solution

by:
Luis Pérez earned 2000 total points
ID: 39193682
Have you tried Json.Net? It's very easy to serialize/deserialize objects with this library, even if your objects contains complex properties.

http://james.newtonking.com/projects/json-net.aspx

Hope that helps.
0
 
LVL 6

Expert Comment

by:worm-getter
ID: 39193765
0
 
LVL 6

Author Closing Comment

by:townsma
ID: 39193784
Thanks, just what I was looking for.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question