I'm having a List of JsonElement, and I want to set the value of each element property through iteration but I don't know how to proceed with a JsonElement object.
Here my code :
List<JsonElement> exportExported = GetDatas();
foreach (JsonElement export in exportExported)
{
//here setting the value of an export. Example : export.reference = "test";
export.GetProperty("reference") = "test" //does not work
System.Threading.Thread.Sleep(2500);
}
Thanks for clues
Mutating JsonElement would not work.
In case you want everything to be done explicitly, you might consider deserializing the json, editing and serializing back if needed.
This way you'll also be sure that the incoming data always has the structure you need