Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/Newtonsoft.Json.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamesNK <james@newtonking.com>2011-05-02 14:52:01 +0400
committerJamesNK <james@newtonking.com>2011-05-02 14:52:01 +0400
commit045a1ec334421a2ac7df5db65fad68f85c297466 (patch)
treee6c0e7bce4f1acd42366607c7229507f8eaa3cd7 /Src/Newtonsoft.Json.Tests/TestObjects/PublicParametizedConstructorWithPropertyNameConflict.cs
parent21a2a7e4f793e395987d60b3ae0296de885c5774 (diff)
-Improved support for deserializing objects using non-default constructors
-JsonConverterAttribute now allowed on constructor parameters -JsonPropertyAttribute now allowed on constructor parameters
Diffstat (limited to 'Src/Newtonsoft.Json.Tests/TestObjects/PublicParametizedConstructorWithPropertyNameConflict.cs')
-rw-r--r--Src/Newtonsoft.Json.Tests/TestObjects/PublicParametizedConstructorWithPropertyNameConflict.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/Src/Newtonsoft.Json.Tests/TestObjects/PublicParametizedConstructorWithPropertyNameConflict.cs b/Src/Newtonsoft.Json.Tests/TestObjects/PublicParametizedConstructorWithPropertyNameConflict.cs
new file mode 100644
index 0000000..1baaa7e
--- /dev/null
+++ b/Src/Newtonsoft.Json.Tests/TestObjects/PublicParametizedConstructorWithPropertyNameConflict.cs
@@ -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; }
+ }
+ }
+}