Created
March 16, 2011 16:25
-
-
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yeah it looks like it should work? I'm assuming the 'object' will be a string? is that what you're getting?