Answer the question
In order to leave comments, you need to log in
json deserialization in c#?
Hello! I can't figure it out with json. I tried all the examples from Google, but the examples there do not match what I need:
[
{
"topic": 1,
"title": "Тест",
"text": "Какой-то текст 1",
"user_id": 1328,
"user": "user 1",
"time": 1454613213
},
{
"topic": 2,
"title": "Тест 2",
"text": "Какой-то текст 2",
"user_id": 1328,
"user": "user 2",
"time": 1454611021
}
]
Answer the question
In order to leave comments, you need to log in
Outside should be { } and not [ ]
I would just wrap the original string in this way before parsing:
{"response": [
{
"topic": 1,
"title": "Тест",
"text": "Какой-то текст 1",
"user_id": 1328,
"user": "user 1",
"time": 1454613213
},
{
"topic": 2,
"title": "Тест 2",
"text": "Какой-то текст 2",
"user_id": 1328,
"user": "user 2",
"time": 1454611021
}
]
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question