I'm consuming a rest api using Restsharp. The response of the api has this structure.
{
"resourceId": "0014b07-92sl-si90",
"property": [
{
"name": "prop1",
"value": "-1.0"
},
{
"name": "prop2",
"value": "0.0"
},
{
"name": "prop3",
"value": "1000.0"
},
{
"name": "prop4",
"value": "Microsoft Windows"
},
{
"name": "prop5",
"value": "42917.0"
}]
}
I want to deserialize this response to this domain model.
public class DomainModel
{
public double Prop1 {get; set;}
public double Prop2 {get; set;}
public double Prop3 {get; set;}
public string Prop4 {get; set;}
}
As you can see I only need a subset of the JSON response properties and the response cannot be deserialized directly to a domain object.
Please how can I solve this issue.
Thank you.