Skip to content

Commit

Permalink
Merge pull request #26 from deadok22/master
Browse files Browse the repository at this point in the history
Document.Id and Document.Rev  properties behaviour
  • Loading branch information
Martin Murphy committed Jan 30, 2012
2 parents d87fda3 + 0f84ea8 commit 6cd9af0
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions LoveSeat/Document.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down

0 comments on commit 6cd9af0

Please sign in to comment.