using Newtonsoft.Json.Linq;
using System.Collections.Generic;
public static void Main()
{"d1", new(){Name = "Dog1"}},
{"d2", new(){Name = "Dog2"}}
{"c1",new(){Name = "Cat1"}},
{"c2",new(){Name = "Cat2"}}
List<Person> peeps = new(){peep1,peep2};
string json = JsonConvert.SerializeObject(peep1,Formatting.Indented);
var peepOut = JsonConvert.DeserializeObject<Person>(json);
Console.WriteLine(peepOut.Pets["d1"].Name);
string jsonList = JsonConvert.SerializeObject(peeps,Formatting.Indented);
Console.WriteLine(jsonList);
var peepsOut = JArray.Parse(jsonList).ToObject<List<Person>>();
Console.WriteLine(peepsOut[0].Pets["d1"].Name);
public string Name { get; set; } = "";
public Dictionary<string, Pet> Pets { get; set; } = new();
public int Id { get; set; }
public string Name { get; set; } = "";