I know that the specs for JSON says that propertynames (keys) should be surrounded by quotes.
But I have a lot of files that I need to read that contains data where the keys might not be quoted.
Earlier, before migration to Core, I used JavaScriptSerializer (that accepts keys without quotes ) but that doesn't exist in .net core.
Any ideas, or alternatives? I am still searching. But after 4 hours I thought that maybe you guys know this.
So, how can I read "{ apa: 23 }" and create a dictionary in .net core?
/thanks
Install-Package Newtonsoft.Json
string json = @"{
'Name': 'name',
'Description': 'des'
}";
Test test = JsonConvert.DeserializeObject<Test>(json);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With