Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

...
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Jan 28, 2012
Sergey Savenko deadok22 Changed Document's Rev and Id properties behaviour. They now use JObj…
…ect's

"_rev" and "_id" fields respectively. It helps to avoid getting different
values from properties and using indexer.
0f84ea8
Commits on Jan 30, 2012
Martin Murphy Merge pull request #26 from deadok22/master
Document.Id and Document.Rev  properties behaviour
6cd9af0
Showing with 17 additions and 4 deletions.
  1. +17 −4 LoveSeat/Document.cs
21 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; }

No commit comments for this range

Something went wrong with that request. Please try again.