Skip to content

Instantly share code, notes, and snippets.

@dragan
Created March 16, 2011 16:25
Show Gist options
  • Save dragan/872762 to your computer and use it in GitHub Desktop.
Save dragan/872762 to your computer and use it in GitHub Desktop.
A little test case for deserializing a JSON object into a Dictionary<string,object>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using ServiceStack.Text;
namespace ServiceStackTest
{
class Program
{
static void Main(string[] args)
{
var json = new StringBuilder();
json.Append("{");
json.Append("\"ListProperty\":[1,2,3,4,5,6,7,8,9,0]");
json.Append("}");
var dictionary = JsonSerializer.DeserializeFromString<Dictionary<string,object>>(json.ToString());
}
}
}
@mythz
Copy link

mythz commented Mar 16, 2011

yeah it looks like it should work? I'm assuming the 'object' will be a string? is that what you're getting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment