Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit 0f84ea897405f7c3a9e547acbb3ad5106ba52545 1 parent d87fda3
@deadok22 deadok22 authored
Showing with 17 additions and 4 deletions.
  1. +17 −4 LoveSeat/Document.cs
View
21 LoveSeat/Document.cs
@@ -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; }
Please sign in to comment.
Something went wrong with that request. Please try again.