Skip to main content

Posts

Showing posts from January, 2013

Convert json string to CLR type

In this post I will show you how to convert json string to CLR types using c#


Assembly Required
System.Web.Design
using System.Collections.Generic; using System.IO; using System.Runtime.Serialization; using System.Runtime.Serialization.Json; using System.Web.Script.Serialization; namespace ConsoleApplication1 { publicclass Likes { public List<Like> data { get; set; } } publicclass Like { publicstring Category { get; set; } publicstring Name { get; set; } publicstring ID { get; set; } publicstring created_time { get; set; } public Like() { } } publicclass Program { staticvoid Main(string[] args) { string jsonData = @"{ ""data"": [ { ""category"": ""Community"", ""name"": ""Swati"", …