-Documentation

This commit is contained in:
James Newton-King
2015-12-13 20:40:33 +13:00
parent 4c256e7afd
commit 60cce16d43
6 changed files with 38 additions and 3 deletions
@@ -125,6 +125,16 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(2, myClass.PostProperty);
}
[Test]
public void CaseInsensitive()
{
string json = @"{""height"":1}";
DoubleClass c = JsonConvert.DeserializeObject<DoubleClass>(json, new JsonSerializerSettings { MissingMemberHandling = MissingMemberHandling.Error });
Assert.AreEqual(1d, c.Height);
}
[Test]
public void MissingMemeber()
{
+5
View File
@@ -138,6 +138,11 @@ namespace Newtonsoft.Json
/// <summary>
/// Gets or sets how type name writing and reading is handled by the serializer.
/// </summary>
/// <remarks>
/// <see cref="TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
/// Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
/// when deserializing with a value other than <c>TypeNameHandling.None</c>.
/// </remarks>
public virtual TypeNameHandling TypeNameHandling
{
get { return _typeNameHandling; }
@@ -156,6 +156,11 @@ namespace Newtonsoft.Json
/// <summary>
/// Gets or sets how type name writing and reading is handled by the serializer.
/// </summary>
/// <remarks>
/// <see cref="TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
/// Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
/// when deserializing with a value other than <c>TypeNameHandling.None</c>.
/// </remarks>
/// <value>The type name handling.</value>
public TypeNameHandling TypeNameHandling
{
+6
View File
@@ -24,12 +24,18 @@
#endregion
using System;
using System.Runtime.Serialization;
namespace Newtonsoft.Json
{
/// <summary>
/// Specifies type name handling options for the <see cref="JsonSerializer"/>.
/// </summary>
/// <remarks>
/// <see cref="TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
/// Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
/// when deserializing with a value other than <c>TypeNameHandling.None</c>.
/// </remarks>
[Flags]
public enum TypeNameHandling
{