I'm using Json.Net for serialization.
I have a class with a Dictionary:
public class Test
{
public string X { get; set; }
public Dictionary<string, string> Y { get; set; }
}
Can I somehow serialize this object to get the following JSON
{
"X" : "value",
"key1": "value1",
"key2": "value2"
}
where "key1", "key2" are keys in the Dictionary?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…