4

I'm looking for a way to deserialize a string coming from an API. The Json string is just : {"key" : "lolo"}.

I dont want to create a class for this. I have found this but it's kind of old so I don't know if there is something better today: Json deserialize

In the future I will use more Json deserialization so I would like to use JSON.NET. Thanks.

1

1 Answer 1

-1

Have a look at this: http://www.newtonsoft.com/json.

Used in almost every .net appilication these days.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks, but in the top right corner, the examples. He create a Movie class. And I don't want to create a class for one value.
You can also deserialize to dictionaries: JsonConvert.DeserializeObject<Dictionary<string, string>>("{ \"foo\": \"bar\" }")
@null This should be a part of the answer as it is the main argument why using netwonsofts library would work.
Use dynamic datatype. like - dynamic obj = Newtonsoft.Json.JsonConvert.DeserializeObject(result.ToString());

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.