• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 382
  • Last Modified:

JSON Deserialization

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.
1 Solution
Luis PérezSoftware Architect in .NetCommented:
Have you tried Json.Net? It's very easy to serialize/deserialize objects with this library, even if your objects contains complex properties.


Hope that helps.
townsmaAuthor Commented:
Thanks, just what I was looking for.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now