I have the following problem in my program:
I receive a JSON with the following structure:
then when deserializing the json it goes well, I have the objects and their keys, but the problem is that the keys have the "-" sign, so I can't
var listProduct = JsonConvert.DeserializeObject<List<ExpandoObject>>(jResult);
foreach (dynamic prod in listProduct)
{
int aid = Convert.ToInt32(prod.aid.ToString());
string title = prod.title;
DateTime sentenceDate = Convert.ToDateTime(prod.property-value_546_iso8601);
Suseso mySuseso = new Suseso(.......);
}
accessing through the index is not possible since the same fields do not always come in the same index. and for example there is a key called "abstract" and if I place miJson.abstract, it throws me an error because it is prohibited.
I need to be able to get the value of :
miJson.property-value_546_iso8601;
miJson.abstract;
In short, how do I change the name of a KEY of my deserialized json?
From already thank you very much.