-Fixed static values being included with fields serialization -Examples! (work in progress)
24 lines
590 B
C#
24 lines
590 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
|
|
{
|
|
public class ReadJson
|
|
{
|
|
public void Example()
|
|
{
|
|
JObject o1 = JObject.Parse(File.ReadAllText(@"c:\videogames.json"));
|
|
|
|
// read JSON directly from a file
|
|
using (StreamReader file = File.OpenText(@"c:\videogames.json"))
|
|
using (JsonTextReader reader = new JsonTextReader(file))
|
|
{
|
|
JObject o2 = (JObject) JToken.ReadFrom(reader);
|
|
}
|
|
}
|
|
}
|
|
} |