While trying to serialize a named value tuple to JSON string, it loses the names assigned to items
(string type, string text) myTypes = ("A", "I am an animal");
var cnvValue = JsonConvert.SerializeObject(myTypes);
I am expecting the serialized value as
{"type":"A","text":"I am an animal"}
but the actual results are
{"Item1":"A","Item2":"I am an animal"}
There are two things that i am interested to know
- Why does it behave like that
- How to get the expected output