Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dictionary<string, object> items = new Dictionary<string, object>();
- items.Add("a number", 1.23f);
- items.Add("a point", new Point(5,6));
- JsonSerializerSettings settings = new JsonSerializerSettings() { Formatting = Formatting.Indented, TypeNameHandling=TypeNameHandling.All };
- var serialized = JsonConvert.SerializeObject(items, settings);
- {
- "$type": "System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Object, mscorlib]], mscorlib",
- "a number": 1.23,
- "a point": "5,6"
- }
- {
- { "a number": 1.23, "$type" : "System.Float, mscorlib..." },
- { "a point": "5,6", "$type" : "System.Drawing.Point..." }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement