Permalink
Browse files

Merge pull request #26 from deadok22/master

Document.Id and Document.Rev  properties behaviour
  • Loading branch information...
2 parents d87fda3 + 0f84ea8 commit 6cd9af0b630c560cb6142ce6484a03ad74ab7c4a @soitgoes committed Jan 30, 2012
Showing with 17 additions and 4 deletions.
  1. +17 −4 LoveSeat/Document.cs
View
@@ -73,11 +73,24 @@ public class BulkDocumentResponse
public class Document : JObject, IBaseObject
{
- [JsonProperty("_id")]
- public string Id { get; set; }
+ [JsonIgnore]
+ public string Id
+ {
+ get {
+ JToken id;
+ return this.TryGetValue("_id", out id) ? id.ToString() : null;
+ }
+ set { this["_id"] = value; }
+ }
- [JsonProperty("_rev")]
- public string Rev { get; set; }
+ [JsonIgnore]
+ public string Rev {
+ get {
+ JToken rev;
+ return this.TryGetValue("_rev", out rev) ? rev.ToString() : null;
+ }
+ set { this["_rev"] = value; }
+ }
public string Type { get; private set; }

0 comments on commit 6cd9af0

Please sign in to comment.