Method SaveAsync
- Namespace
- IntentSharp.Documents
- Assembly
- IntentSharp.dll
SaveAsync(DocumentSave, CancellationToken)
Stores a new version of a document and, when Activate is true, makes it the running version. Returns the new version.
public ValueTask<DocumentVersion> SaveAsync(DocumentSave save, CancellationToken ct = default)
Parameters
saveDocumentSaveThe text, author and options of the new version.
ctCancellationTokenCancels the call.
Returns
- ValueTask<DocumentVersion>
Exceptions
- ArgumentNullException
saveis null.- ArgumentException
The save's Id is a default DocumentId, which names no document, or its text or author is null.
- DocumentConflictException
BasedOn is set and is not the running sequence. Nothing was stored.
- ArgumentException
The document's working copy would lie in the state folder (StateRoot), which holds the store's own files, or its path leads through a link out of the working folder; or the text is larger than MaxDocumentBytes in UTF-8.
- ObjectDisposedException
The store is disposed.
- IOException
The version could not be written, or the lock file stayed held by another instance for LockTimeout.
- InvalidOperationException
A document validator called it while this store was checking an edit (see the class remarks).