I’m now using ListItem() for Json format result, but the generated Json text has an extra property called 'selected = false', I know this is used for drop down list, but I want my app runs faster so I don’t want this property. Do you know any other way to get the similar result?
Here is my code:
List<ListItem> list = new List<ListItem>() { new ListItem() { Text = 'Email', Value = 'Pls enter your email' }, new ListItem() { Text = 'NameFull', Value = 'Pls enter your full name' }, new ListItem() { Text = 'Sex', Value = 'Pls choose your sex' } };
Depending on your JSON serialiser you may or may not be able to tell the serialiser to ignore this property.
You’d be better off just creating a class that only has the fields you need. e.g.