public void with_promise_and_create_handle_should_be_linked_to_document_1() { _writer.Promise(_handle1, 1); _writer.CreateIfMissing(_handle1, null, 1); _writer.LinkDocument(_handle1, _doc1, 2); var h = _writer.FindOneById(_handle1); Assert.AreEqual(_doc1, h.DocumentDescriptorId); }
void HandleDocumentCreation(ICommit committed) { var docCreated = committed.Events .Where(x => x.Body is DocumentDescriptorInitialized) .Select(x => (DocumentDescriptorInitialized)x.Body) .FirstOrDefault(); if (docCreated != null) { _handleWriter.Promise( docCreated.HandleInfo.Handle, committed.CheckpointToken ); } }