1
I have the following JSON file:
{
"createdAt":"Apr 17, 2019 10:28:39",
"id":"52329770-64e2-4759-9d3d-f2595973de4e",
"items":[
{
"id":"82d2e4ab-da74-45df-a9ea-99cc257ead59",
"name":"REFRIGERANTE KS",
"quantity":1,
"sku":"20",
"unitOfMeasure":"un",
"unitPrice":1440
}
],
"notes":"MESA",
"paidAmount":1440,
"payments":[
{
"accessKey":"0gyZYCs8kJIucvOCdc7dsNvOehcsRXTRX2iGNFUr7hdc1sUWx5",
"amount":1440,
"applicationName":"CieloLIO",
"paymentFields":{
"clientName":"CieloLio",
"upFrontAmount":"1000",
"creditAdminTax":"500",
"hasSignature":"true",
"hasPrintedClientReceipt":"true",
"primaryProductName":"DEBITO",
"reference":"112121"
},
"primaryCode":"8",
"secondaryCode":"208",
"terminal":"mock_terminal"
}
],
"pendingAmount":0,
"price":1440,
"reference":"284807",
"status":"PAID",
"type":"PAYMENT",
"updatedAt":"Apr 17, 2019 10:29:06"
}
How do I turn this into an object? Do I have to have a class with all these properties? What function do I use to transform into an object?
Give a web-searched how to install Newtonsoft nuget.Json, he does it! You will only need to create the model to store these values and call a function from it...
– Lodi
I make the recommendation table of @Lodi. Use the Json.NET
– Augusto Vasques
You will need all the information or just some data?
– Leandro Angelo
At first I won’t need all the information. I managed to solve using Newtonsoft.Json, thanks!
– Artur Brasil