Answers for "C# Search in JSON without deserialization"

C#
0

C# Search in JSON without deserialization

using (var fs = File.OpenRead(path))
using (var textReader = new StreamReader(fs))
using (var reader = new JsonTextReader(textReader))
{
    while (reader.Read())
    {
        if (reader.TokenType == JsonToken.StartObject)
        {
            var obj = JObject.Load(reader);
            Debug.WriteLine("{0} - {1}", obj["id"], obj["name"]);
        }
    }
}
Posted by: Guest on September-06-2021

Code answers related to "C# Search in JSON without deserialization"

C# Answers by Framework

Browse Popular Code Answers by Language