-Improved default null and value handing when JSON value is not compatible with property value

-Added interfaces, structs and enums as valid targets of JsonConverterAttribute
This commit is contained in:
JamesNK
2010-05-27 08:37:34 +00:00
parent fc6c041196
commit f5ed7be283
7 changed files with 59 additions and 4 deletions
@@ -26,6 +26,7 @@
#if !PocketPC && !NET20
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
@@ -34,6 +35,8 @@ namespace Newtonsoft.Json.Tests.TestObjects
public class DateTimeTestClass
{
public string PreField { get; set; }
[DefaultValue("")]
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public DateTime DateTimeField { get; set; }
public DateTimeOffset DateTimeOffsetField { get; set; }
public string PostField { get; set; }