public Guid?GetLastWrittenEtag() { DocumentStore.EtagHolder etagHolder = this.lastEtag; if (etagHolder == null) { return(new Guid?()); } else { return(new Guid?(etagHolder.Etag)); } }
internal void UpdateLastWrittenEtag(Guid?etag) { if (!etag.HasValue) { return; } byte[] y = etag.Value.ToByteArray(); if (this.lastEtag == null) { lock (this.lastEtagLocker) { if (this.lastEtag == null) { this.lastEtag = new DocumentStore.EtagHolder() { Bytes = y, Etag = etag.Value }; return; } } } if (Buffers.Compare(this.lastEtag.Bytes, y) >= 0) { return; } lock (this.lastEtagLocker) { if (Buffers.Compare(this.lastEtag.Bytes, y) >= 0) { return; } this.lastEtag = new DocumentStore.EtagHolder() { Etag = etag.Value, Bytes = y }; } }
internal void UpdateLastWrittenEtag(Guid? etag) { if (!etag.HasValue) return; byte[] y = etag.Value.ToByteArray(); if (this.lastEtag == null) { lock (this.lastEtagLocker) { if (this.lastEtag == null) { this.lastEtag = new DocumentStore.EtagHolder() { Bytes = y, Etag = etag.Value }; return; } } } if (Buffers.Compare(this.lastEtag.Bytes, y) >= 0) return; lock (this.lastEtagLocker) { if (Buffers.Compare(this.lastEtag.Bytes, y) >= 0) return; this.lastEtag = new DocumentStore.EtagHolder() { Etag = etag.Value, Bytes = y }; } }