C# JSON Serializer

Add Reference to System.Web.Extensions

[Test]
public void Test()
{
    var serializer = new JavaScriptSerializer();
    var input = new SerializationTest() { Id = 1 };
    var text = serializer.Serialize(input);
    Console.WriteLine(text);
    var output = serializer.Deserialize<SerializationTest>(text);
    Console.WriteLine("Id: {0}", output.Id);
}
class SerializationTest
{
    public int Id { get; set; }
}

Comments

Popular posts from this blog

Tibco Rendezvous (tibrv) C# .Net example

Parse XML to dynamic object in C#