Method SubmitAsync
- Namespace
- IntentSharp.Edits
- Assembly
- IntentSharp.dll
SubmitAsync(ProposedEdit, CancellationToken)
Saves a document edit as a new running version, based on BasedOn, with the edit's author and reason, and returns Applied with that version. Returns Conflict when another version became running since the edit was based on it, and Refused, storing nothing, for an edit whose Impact does not load cleanly (an edit the library did not check, or one its validators failed), an edit the store refuses to save (its SaveAsync(DocumentSave, CancellationToken) throws ArgumentException, as a FolderDocumentStore does for a text larger than its MaxDocumentBytes or a path it does not write; the reason is the store's message), a mapping edit while no mapping store is configured, or a kind it does not apply. A mapping edit replaces the revision it is based on in MappingStore: Applied means the store holds the edit's row as the active revision; Conflict means that revision was no longer active, or another writer replaced it first, and nothing was stored; Refused means the edit's kind or shapes are not that revision's, so the row would be refused on every read, and nothing was stored.
public ValueTask<EditOutcome> SubmitAsync(ProposedEdit edit, CancellationToken ct = default)
Parameters
editProposedEditThe checked edit.
ctCancellationTokenCancels the save.
Returns
- ValueTask<EditOutcome>
What was done, with the saved version when one was saved.
Exceptions
- ArgumentNullException
editis null.- ArgumentException
The edit has no content or author, or it is a document edit that names no document.