Json.NET is able to deserialize your example JSON into an instance of your DTO class. It seems that the JSON parsing library you're using is buggy. Are you able to switch?
internal class Program
{
private static void Main()
{
const string json = @"{
""Values"": {
""Category"": ""2"",
""Name"": ""Test"",
""Description"": ""Testing"",
""Expression"": ""[Total Items] * 100""
}
}";
var myDto = JsonConvert.DeserializeObject<MyDto>(json);
}
}
public class MyDto
{
public Dictionary<string, object> Values
{
get;
set;
}
}
EDIT:
I switched my code to use ServiceStack.Text from NuGet and I was able to get the serialization to work perfectly:
var myDto = JsonSerializer.DeserializeFromString<MyDto>(json);