I have to serialize a list of objects in Json in C#, I'm using Newtonsoft.Json I need to use the name value of the objects as the root name, like this:
"employees" :
{
"John" :
{
"id" : 18,
"email" : "john@email.com"
},
"Jack" :
{
"id" : 21,
"email" : "jack@email.com"
}
}
Where John and Jack are the values of the name property for my employees