I am using Newtonsoft.Json serializer to convert C# classes to JSON. For some classes I don\'t need the serializer to an instance to individual properties, but instead just
You can simply try Newtonsoft's JSON builder library and Serilaize the object of type Person using such code:
Dictionary collection = new Dictionary()
{
{"First", new Person()},
{"Second", new Person()},
};
string json = JsonConvert.SerializeObject(collection, Formatting.Indented, new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.All,
TypeNameAssemblyFormat = FormatterAssemblyStyle.Simple
});