-Improved support for deserializing objects using non-default constructors

-JsonConverterAttribute now allowed on constructor parameters
-JsonPropertyAttribute now allowed on constructor parameters
This commit is contained in:
JamesNK
2011-05-02 10:52:01 +00:00
parent 21a2a7e4f7
commit 045a1ec334
19 changed files with 467 additions and 111 deletions
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Newtonsoft.Json.Tests.TestObjects
{
public class PublicParametizedConstructorWithPropertyNameConflict
{
private readonly int _value;
public PublicParametizedConstructorWithPropertyNameConflict(string name)
{
_value = Convert.ToInt32(name);
}
public int Name
{
get { return _value; }
}
}
public class PublicParametizedConstructorWithPropertyNameConflictWithAttribute
{
private readonly int _value;
public PublicParametizedConstructorWithPropertyNameConflictWithAttribute([JsonProperty("name")]string nameParameter)
{
_value = Convert.ToInt32(nameParameter);
}
public int Name
{
get { return _value; }
}
}
}