Open
Description
For example below is the one example of JSON which I need to deserialize to List:
Example:
`[
{
"Name": "configuration/ABC",
"Alias": null,
"Timestamp": null,
"IsHistorical": null,
"IsTransient": null,
"IsNull": false,
"MetaData": null,
"Properties": null,
"Value": {
"Version": "",
"Metrics": [
{
"Name": "product",
"Alias": null,
"Timestamp": null,
"IsHistorical": null,
"IsTransient": null,
"IsNull": false,
"MetaData": null,
"Properties": null,
"Value": "ABC",
"DataType": 12
}
],
"Parameters": [
],
"TemplateRef": "",
"IsDefinition": null
},
"DataType": 19
}
]`
C# code:
var metric = JsonConvert.DeserializeObject<List<Metric>>(metrics); var metric = System.Text.Json.JsonSerializer.Deserialize<List<Metric>>(metrics);
Now after deserialize, it will give value as null.