diff --git a/Doc/Introduction.aml b/Doc/Introduction.aml index efbf64d2..ac4313c1 100644 --- a/Doc/Introduction.aml +++ b/Doc/Introduction.aml @@ -31,7 +31,7 @@ Convert JSON to and from XML - Supports .NET 2, .NET 3.5, .NET 4, .NET 4.5, Silverlight, Windows Phone and Windows 8 RT + Supports .NET 2, .NET 3.5, .NET 4, .NET 4.5, Silverlight, Windows Phone and Windows 8 Store @@ -57,6 +57,11 @@ and write from your objects. LINQ to JSON LINQtoJSON.htm _self + + +Samples +Samples.htm +_self @@ -85,7 +90,7 @@ and write from your objects. _blank , a JSON based documentat database; - SignalR + ASP.NET SignalR http://signalr.net/ _blank , @@ -105,14 +110,16 @@ and write from your objects.
Donate Json.NET is a personal open source project. Started in 2006, I have put hundreds of hours adding, refining and tuning Json.NET with the goal to make it not just the best JSON serializer for .NET but the best serializer for any computer language. I need your - help to achieve this. -
+ help to achieve this.

Click here to lend your support to: Json.NET and make a donation at www.pledgie.com !

+ + + Serializing and Deserializing JSON @@ -124,6 +131,11 @@ and write from your objects. LINQtoJSON.htm _self + + Samples + Samples.htm + _self + diff --git a/Doc/Samples/Bson/DeserializeFromBsonCollection.aml b/Doc/Samples/Bson/DeserializeFromBsonCollection.aml index d677741f..71609c9b 100644 --- a/Doc/Samples/Bson/DeserializeFromBsonCollection.aml +++ b/Doc/Samples/Bson/DeserializeFromBsonCollection.aml @@ -3,7 +3,7 @@ This sample sets P:Newtonsoft.Json.Bson.BsonReader.ReadRootValueAsArray - to true so the root BSON value is correctly read + to true so the root BSON value is correctly read as an array instead of an object and deserializes BSON to a collection.
diff --git a/Doc/Samples/Linq/FromObject.aml b/Doc/Samples/Linq/FromObject.aml index 9dcc9cff..505ba1c3 100644 --- a/Doc/Samples/Linq/FromObject.aml +++ b/Doc/Samples/Linq/FromObject.aml @@ -3,7 +3,7 @@ This sample converts .NET values to LINQ to JSON using - M:Newtonsoft.Json.Linq.JToken.FromObject(System.Object). + M:Newtonsoft.Json.Linq.JToken.FromObject(System.Object).
Sample diff --git a/Doc/Samples/Linq/ParseJsonAny.aml b/Doc/Samples/Linq/ParseJsonAny.aml index d650ae30..7054421d 100644 --- a/Doc/Samples/Linq/ParseJsonAny.aml +++ b/Doc/Samples/Linq/ParseJsonAny.aml @@ -3,7 +3,7 @@ This sample parses JSON using - M:Newtonsoft.Json.Linq.JToken.Parse(System.String). + M:Newtonsoft.Json.Linq.JToken.Parse(System.String).
Sample diff --git a/Doc/Samples/Linq/ParseJsonArray.aml b/Doc/Samples/Linq/ParseJsonArray.aml index cf6708dd..842a47b4 100644 --- a/Doc/Samples/Linq/ParseJsonArray.aml +++ b/Doc/Samples/Linq/ParseJsonArray.aml @@ -3,7 +3,7 @@ This sample parses a JSON array using - M:Newtonsoft.Json.Linq.JArray.Parse(System.String). + M:Newtonsoft.Json.Linq.JArray.Parse(System.String).
Sample diff --git a/Doc/Samples/Linq/ParseJsonObject.aml b/Doc/Samples/Linq/ParseJsonObject.aml index 0a073cae..b2d7744f 100644 --- a/Doc/Samples/Linq/ParseJsonObject.aml +++ b/Doc/Samples/Linq/ParseJsonObject.aml @@ -3,7 +3,7 @@ This sample parses a JSON object using - M:Newtonsoft.Json.Linq.JObject.Parse(System.String). + M:Newtonsoft.Json.Linq.JObject.Parse(System.String).
Sample diff --git a/Doc/Samples/Schema/CreateJsonSchemaManually.aml b/Doc/Samples/Schema/CreateJsonSchemaManually.aml index 7736afdb..2818e755 100644 --- a/Doc/Samples/Schema/CreateJsonSchemaManually.aml +++ b/Doc/Samples/Schema/CreateJsonSchemaManually.aml @@ -3,7 +3,7 @@ This sample creates a new T:Newtonsoft.Json.Schema.JsonSchema - instance manually in code instead of loading an existing schema from JSON. + instance manually in code.
Sample diff --git a/Doc/Samples/Schema/JsonSchemaParse.aml b/Doc/Samples/Schema/JsonSchemaParse.aml index b2c24cbe..40df194d 100644 --- a/Doc/Samples/Schema/JsonSchemaParse.aml +++ b/Doc/Samples/Schema/JsonSchemaParse.aml @@ -2,7 +2,7 @@ - This sample parses a T:Newtonsoft.Json.Schema.JsonSchema. + This sample parses a T:Newtonsoft.Json.Schema.JsonSchema from JSON
diff --git a/Doc/Samples/Serializer/DataContractAndDataMember.aml b/Doc/Samples/Serializer/DataContractAndDataMember.aml index 7613bee3..5a705a15 100644 --- a/Doc/Samples/Serializer/DataContractAndDataMember.aml +++ b/Doc/Samples/Serializer/DataContractAndDataMember.aml @@ -11,8 +11,8 @@
Sample - - + +
diff --git a/Doc/Samples/Serializer/JsonObjectAttributeOverrideIEnumerable.aml b/Doc/Samples/Serializer/JsonObjectAttributeOverrideIEnumerable.aml index cb4ad81c..2ca16de3 100644 --- a/Doc/Samples/Serializer/JsonObjectAttributeOverrideIEnumerable.aml +++ b/Doc/Samples/Serializer/JsonObjectAttributeOverrideIEnumerable.aml @@ -3,7 +3,7 @@ This sample uses T:Newtonsoft.Json.JsonObjectAttribute - to serialize a class that implements I:System.Collections.IEnumerable`1 as + to serialize a class that implements T:System.Collections.Generic.IEnumerable`1 as a JSON object instead of a JSON array.
diff --git a/Doc/SerializationGuide.aml b/Doc/SerializationGuide.aml index 4ee4a118..8f896314 100644 --- a/Doc/SerializationGuide.aml +++ b/Doc/SerializationGuide.aml @@ -235,7 +235,7 @@ T:System.Dynamic.ExpandoObject is a good example of a dynamic object. Dynamic objects are serialized as JSON objects. A property is written for every member name returned by - M:System.Dynamic.DynamicMetaObject.GetDynamicMemberNames. + M:System.Dynamic.DynamicMetaObject.GetDynamicMemberNames. When deserializing dynamic objects the serializer first attempts to set JSON property values on a normal .NET member with the matching name. If no .NET member is found with the property name then the serializer will call SetMember on the dynamic object. Because there is no type information for dynamic members on a dynamic object the diff --git a/Doc/doc.content b/Doc/doc.content index 530be2dc..8ec6c65d 100644 --- a/Doc/doc.content +++ b/Doc/doc.content @@ -83,17 +83,17 @@ - + - + diff --git a/Src/Newtonsoft.Json.Tests/Documentation/LinqToJsonTests.cs b/Src/Newtonsoft.Json.Tests/Documentation/LinqToJsonTests.cs index 45ffc014..3682b981 100644 --- a/Src/Newtonsoft.Json.Tests/Documentation/LinqToJsonTests.cs +++ b/Src/Newtonsoft.Json.Tests/Documentation/LinqToJsonTests.cs @@ -164,7 +164,7 @@ namespace Newtonsoft.Json.Tests.Documentation // "item": [ // { // "title": "Json.NET 1.3 + New license + Now on CodePlex", - // "description": "Annoucing the release of Json.NET 1.3, the MIT license and the source being available on CodePlex", + // "description": "Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex", // "link": "http://james.newtonking.com/projects/json-net.aspx", // "category": [ // "Json.NET", diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Samples/Linq/CreateJsonDeclaratively.cs b/Src/Newtonsoft.Json.Tests/Documentation/Samples/Linq/CreateJsonDeclaratively.cs index 5debfec5..b88418e4 100644 --- a/Src/Newtonsoft.Json.Tests/Documentation/Samples/Linq/CreateJsonDeclaratively.cs +++ b/Src/Newtonsoft.Json.Tests/Documentation/Samples/Linq/CreateJsonDeclaratively.cs @@ -58,7 +58,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq // "item": [ // { // "title": "Json.NET 1.3 + New license + Now on CodePlex", - // "description": "Annoucing the release of Json.NET 1.3, the MIT license and the source being available on CodePlex", + // "description": "Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex", // "link": "http://james.newtonking.com/projects/json-net.aspx", // "category": [ // "Json.NET", diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Samples/Linq/CreateJsonManually.cs b/Src/Newtonsoft.Json.Tests/Documentation/Samples/Linq/CreateJsonManually.cs index dd3faeed..5840301e 100644 --- a/Src/Newtonsoft.Json.Tests/Documentation/Samples/Linq/CreateJsonManually.cs +++ b/Src/Newtonsoft.Json.Tests/Documentation/Samples/Linq/CreateJsonManually.cs @@ -12,11 +12,8 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq { #region Usage JArray array = new JArray(); - JValue text = new JValue("Manual text"); - JValue date = new JValue(new DateTime(2000, 5, 23)); - - array.Add(text); - array.Add(date); + array.Add("Manual text"); + array.Add(new DateTime(2000, 5, 23)); JObject o = new JObject(); o["MyArray"] = array; diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Samples/Schema/SaveJsonSchemaToFile.cs b/Src/Newtonsoft.Json.Tests/Documentation/Samples/Schema/SaveJsonSchemaToFile.cs index bad3be79..cf35e223 100644 --- a/Src/Newtonsoft.Json.Tests/Documentation/Samples/Schema/SaveJsonSchemaToFile.cs +++ b/Src/Newtonsoft.Json.Tests/Documentation/Samples/Schema/SaveJsonSchemaToFile.cs @@ -12,7 +12,10 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema public void Example() { #region Usage - JsonSchema schema = JsonSchema.Parse(@"{'type': 'object'}"); + JsonSchema schema = new JsonSchema + { + Type = JsonSchemaType.Object + }; // serialize JsonSchema to a string and then write string to a file File.WriteAllText(@"c:\schema.json", schema.ToString()); diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Samples/Serializer/DataContractAndDataMember.cs b/Src/Newtonsoft.Json.Tests/Documentation/Samples/Serializer/DataContractAndDataMember.cs index 03b517a4..61d059a2 100644 --- a/Src/Newtonsoft.Json.Tests/Documentation/Samples/Serializer/DataContractAndDataMember.cs +++ b/Src/Newtonsoft.Json.Tests/Documentation/Samples/Serializer/DataContractAndDataMember.cs @@ -8,7 +8,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer { public class DataContractAndDataMember { - #region Usage + #region Types [DataContract] public class File { diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Samples/Serializer/DeserializeAnonymousType.cs b/Src/Newtonsoft.Json.Tests/Documentation/Samples/Serializer/DeserializeAnonymousType.cs index d5a14c17..e15d219c 100644 --- a/Src/Newtonsoft.Json.Tests/Documentation/Samples/Serializer/DeserializeAnonymousType.cs +++ b/Src/Newtonsoft.Json.Tests/Documentation/Samples/Serializer/DeserializeAnonymousType.cs @@ -10,14 +10,19 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer public void Example() { #region Usage - string json = @"{'Name':'James'}"; + var definition = new {Name = ""}; - var customerDefinition = new {Name = ""}; + string json1 = @"{'Name':'James'}"; + var customer1 = JsonConvert.DeserializeAnonymousType(json1, definition); - var customer = JsonConvert.DeserializeAnonymousType(json, customerDefinition); - - Console.WriteLine(customer.Name); + Console.WriteLine(customer1.Name); // James + + string json2 = @"{'Name':'Mike'}"; + var customer2 = JsonConvert.DeserializeAnonymousType(json2, definition); + + Console.WriteLine(customer2.Name); + // Mike #endregion } } diff --git a/Src/Newtonsoft.Json.Tests/Linq/LinqToJsonTest.cs b/Src/Newtonsoft.Json.Tests/Linq/LinqToJsonTest.cs index c31544c9..05867981 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/LinqToJsonTest.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/LinqToJsonTest.cs @@ -396,7 +396,7 @@ keyword such as type of business."" new Post() { Title = "Json.NET 1.3 + New license + Now on CodePlex", - Description = "Annoucing the release of Json.NET 1.3, the MIT license and the source being available on CodePlex", + Description = "Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex", Link = "http://james.newtonking.com/projects/json-net.aspx", Categories = new List() { "Json.NET", "CodePlex" } } @@ -438,7 +438,7 @@ keyword such as type of business."" // "item": [ // { // "title": "Json.NET 1.3 + New license + Now on CodePlex", - // "description": "Annoucing the release of Json.NET 1.3, the MIT license and the source being available on CodePlex", + // "description": "Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex", // "link": "http://james.newtonking.com/projects/json-net.aspx", // "category": [ // "Json.NET", @@ -497,7 +497,7 @@ keyword such as type of business."" ""item"": [ { ""title"": ""Json.NET 1.3 + New license + Now on CodePlex"", - ""description"": ""Annoucing the release of Json.NET 1.3, the MIT license and the source being available on CodePlex"", + ""description"": ""Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex"", ""link"": ""http://james.newtonking.com/projects/json-net.aspx"", ""category"": [ ""Json.NET"", @@ -744,7 +744,7 @@ keyword such as type of business."" ""item"": [ { ""title"": ""Json.NET 1.3 + New license + Now on CodePlex"", - ""description"": ""Annoucing the release of Json.NET 1.3, the MIT license and the source being available on CodePlex"", + ""description"": ""Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex"", ""link"": ""http://james.newtonking.com/projects/json-net.aspx"", ""category"": [ ""Json.NET"", @@ -769,7 +769,7 @@ keyword such as type of business."" ""item"": [ { ""title"": ""Json.NET 1.3 + New license + Now on CodePlex"", - ""description"": ""Annoucing the release of Json.NET 1.3, the MIT license and the source being available on CodePlex"", + ""description"": ""Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex"", ""link"": ""http://james.newtonking.com/projects/json-net.aspx"", ""category"": [ ""Json.NET"", diff --git a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs index 1ef8e2f8..a4e61e61 100644 --- a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs @@ -76,5 +76,5 @@ using System.Security; // by using the '*' as shown below: [assembly: AssemblyVersion("4.5.0.0")] #if !PocketPC -[assembly: AssemblyFileVersion("4.5.11.15728")] +[assembly: AssemblyFileVersion("4.5.11.15729")] #endif diff --git a/Src/Newtonsoft.Json/Linq/JObject.cs b/Src/Newtonsoft.Json/Linq/JObject.cs index 2f8d1d43..ac33e1c4 100644 --- a/Src/Newtonsoft.Json/Linq/JObject.cs +++ b/Src/Newtonsoft.Json/Linq/JObject.cs @@ -382,7 +382,7 @@ namespace Newtonsoft.Json.Linq /// Gets the with the specified property name. /// /// Name of the property. - /// The with the specified property name. + /// The with the specified property name. public JToken GetValue(string propertyName) { return GetValue(propertyName, StringComparison.Ordinal); @@ -395,7 +395,7 @@ namespace Newtonsoft.Json.Linq /// /// Name of the property. /// One of the enumeration values that specifies how the strings will be compared. - /// The with the specified property name. + /// The with the specified property name. public JToken GetValue(string propertyName, StringComparison comparison) { if (propertyName == null) diff --git a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs index 79341bd9..8e95c4f0 100644 --- a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs @@ -90,7 +90,7 @@ using System.Security; // by using the '*' as shown below: [assembly: AssemblyVersion("4.5.0.0")] #if !PocketPC -[assembly: AssemblyFileVersion("4.5.11.15728")] +[assembly: AssemblyFileVersion("4.5.11.15729")] #endif [assembly: CLSCompliant(true)]