So basically I have this class in c# that I want to deserialize to, Here is the class:
public class Data {
public string Name{get;set;}
public string Label{get;set;}
public string Unit{get;set;}
public int Precision{get;set;}
[JsonPropertyAttribute("type")]
public Type DataType{get;set;}
}
And my Json String looks like this:
{
"name": "ACCurrent",
"label": "ACCurrent",
"unit": "A",
"precision": 2,
"type": "float"
}
But the I don't know how to write a custom converter to convert "float" to typeof(float). I saw the documentation and I think I need to work on the WriteJson method under converter. But I don't quite understand how I should do it. Any help would be appreciated!