Documentation
Table of Contents

Method ActivateAsync

Namespace
IntentSharp.Documents
Assembly
IntentSharp.dll

ActivateAsync(DocumentId, long, CancellationToken)

Makes a stored version the document's running version, as a revert to an older version or the promotion of a version saved without activation. Activating the running version changes nothing and returns it.

public ValueTask<DocumentVersion> ActivateAsync(DocumentId id, long sequence, CancellationToken ct = default)

Parameters

id DocumentId

The document.

sequence long

The version to run.

ct CancellationToken

Cancels the call.

Returns

ValueTask<DocumentVersion>

Exceptions

ArgumentException

A default DocumentId, which names no document.

InvalidOperationException

The document has no version with that sequence, or the version is rejected; the message says which, with the rejection reason.

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.

ObjectDisposedException

The store is disposed.

IOException

The version's text could not be read, or the lock file stayed held by another instance for LockTimeout.

InvalidOperationException

The document has no version with that sequence, or the version is rejected; the message says which, with the rejection reason. Or a document validator called it while this store was checking an edit (see the class remarks).