Skip to content

Instantly share code, notes, and snippets.

@ElemarJR
Created November 29, 2016 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ElemarJR/f31c55c0b77bf9c757ae2807b0e27261 to your computer and use it in GitHub Desktop.
Save ElemarJR/f31c55c0b77bf9c757ae2807b0e27261 to your computer and use it in GitHub Desktop.
_subscription = DocumentStoreHolder.Store
.Changes()
.ForDocument(CategoryIdTextbox.Text)
.Where(change =>
{
if (!_justSaved) return true;
_justSaved = false;
var localEtag = _session.Advanced.GetEtagFor(_category);
var numberOfServerChanges = change.Etag.Changes - localEtag.Changes;
return numberOfServerChanges > 1;
})
.Subscribe(DocumentChangedOnServer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment