I'm starting using C# and have a lot to learn.
I'm trying to create a JSON file with a dictionary (thats easy).
JsonSerializer.Serialize(MyDictionary)
But it returns the data without descriptions...
{
"-0255504",
"1"
},
{
:"08000301",
:"1"
}
I want to to include some descriptions like:
{
"ArticleId":"-0255504",
"OrderedQuantity":"1"
},
{
"ArticleId":"08000301",
"OrderedQuantity":"1"
},
{
"ArticleId":"03820235",
"OrderedQuantity":"1"
}
For sure is easy to include and don't want to use List for my program.
Is available any method or property to modify the format?
I'm Using System.Text.Json;