Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #26 from deadok22/master

Document.Id and Document.Rev  properties behaviour
  • Loading branch information...
commit 6cd9af0b630c560cb6142ce6484a03ad74ab7c4a 2 parents d87fda3 + 0f84ea8
Martin Murphy authored January 30, 2012

Showing 1 changed file with 17 additions and 4 deletions. Show diff stats Hide diff stats

  1. 21  LoveSeat/Document.cs
21  LoveSeat/Document.cs
@@ -73,11 +73,24 @@ public class BulkDocumentResponse
73 73
 
74 74
     public class Document : JObject, IBaseObject
75 75
     {
76  
-        [JsonProperty("_id")]
77  
-        public string Id { get; set; }
  76
+        [JsonIgnore]
  77
+        public string Id
  78
+        {
  79
+            get { 
  80
+                JToken id;
  81
+                return this.TryGetValue("_id", out id) ? id.ToString() : null;
  82
+            } 
  83
+            set { this["_id"] = value; }
  84
+        }
78 85
 
79  
-        [JsonProperty("_rev")]
80  
-        public string Rev { get; set; }
  86
+        [JsonIgnore]
  87
+        public string Rev { 
  88
+            get { 
  89
+                JToken rev;
  90
+                return this.TryGetValue("_rev", out rev) ? rev.ToString() : null;
  91
+            }
  92
+            set { this["_rev"] = value; }
  93
+        }
81 94
 
82 95
         public string Type { get; private set; }
83 96
 

0 notes on commit 6cd9af0

Please sign in to comment.
Something went wrong with that request. Please try again.