Saving Changes

Pending registered operations (RegisterUpload, RegisterRename, RegisterFileDeletion or metadata changes) will not be sent to the server until the SaveChangesAsync is called.

Syntax

Task SaveChangesAsync();
Return Value
Task A task that represents the asynchronous save operation

Applying Changes

The RavenFS session, in contrast to the IDocumentSession, does not send changes as a batch operation in a single call. Each registered file modification will be executed in a separate request.

If the exception occurs when the file change is applied, the exception will be thrown by the SaveChangesAsync and any pending modifications will be canceled.

Example

await session.SaveChangesAsync();