I receive a Json that looks like this:
[
{
"FieldName": "Note",
"Value": "Test of a note"
},
{
"FieldName": "P&IPayment",
"Value": "Payment amount"
},
{
"FieldName": "000-002",
"Value": "ABC"
},
]
I want to deserialize it to a class that looks like this:
public class ExportModel
{
[Newtonsoft.Json.JsonPropertyAttribute("Note")]
public string Note { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("P&IPAYMENT")]
public string PAndIPayment { get; set; }
[Newtonsoft.Json.JsonPropertyAttribute("000-002")]
public string MajorLoanType { get; set; }
}
I want the FieldName to map to the attribute of the property and the Value to map to the property.
Thank you for any help.