Skip to content

Cancel Sync #989

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

You must be logged in to vote

I used this code for your scenario, where the input from the console decides if we are cancelling or not:

var progress = new SynchronousProgress<ProgressArgs>(s =>
    Console.WriteLine($"{s.ProgressPercentage:p}:  " +
    $"\t[{s?.Source?[..Math.Min(4, s.Source.Length)]}] {s.TypeName}: {s.Message}"));

options.DisableConstraintsOnApplyChanges = true;
options.TransactionMode = TransactionMode.PerBatch;

var agent = new SyncAgent(clientProvider, serverProvider, options);

CancellationTokenSource cts = null;

agent.LocalOrchestrator.OnRowsChangesSelected(rcsa =>
{
    Console.WriteLine($"OnRowsChangesSelected: {rcsa.SyncRow}");

    Console.Write("Cancel sync ? [Y] / [N]: ");
    var key =

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by workgroupengineering
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