Код: Выделить всё
public void CustomerMethod(string Content)
{
dynamic jsonData = JsonSerializer.Deserialize(Content);
string myvalue1 = jsonData["myvalue1"];
string myvalue2 = jsonData["myvalue2"];
}
Код: Выделить всё
public void MyMethod()
{
string Json = @"{
""myvalue1"": ""Somevalue1"",
""myvalue2"": ""Somevalue2""
}";
CustomerMethod(Json);
}
Код: Выделить всё
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'The best overloaded method match
for 'System.Text.Json.JsonElement.this[int]' has some invalid arguments'
Подробнее здесь: https://stackoverflow.com/questions/791 ... sed-to-fet
Мобильная версия