Skip to content

Intercepting changes from client's local database #604

Answered by Mimetis
ChristianFrom asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @ChristianFrom.

Depending on your need, you have two solutions:

If you want to know the rows to send, before trying to sync, you can use this kind of code:

// Creating an agent that will handle all the process
var agent = new SyncAgent(clientProvider, serverProvider, options, setup);

// Get changes to be populated to the server
var changes = await agent.LocalOrchestrator.GetChangesAsync();

// enumerate changes retrieved on the client, to be sent to server
foreach (var tableChanges in changes.ClientChangesSelected.TableChangesSelected)
{
    var enumerableOfTables = changes.ClientBatchInfo.GetTableAsync(
        tableChanges.TableName, tableChanges.SchemaName, options.SerializerFactory);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ChristianFrom
Comment options

Answer selected by Mimetis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants