I have a dynamic object that looks like this,
{ \"2\" : \"foo\", \"5\" : \"bar\", \"8\" : \"foobar\" }
How can I convert this
Very similar to ema answer, but with a one-liner using LINQ magic:
Dictionary myDict = sourceObject.GetType().GetProperties().ToDictionary(prop => prop.Name, prop => prop.GetValue(sourceObject, null));