Search code examples
azuresynchronizationmicrosoft-sync-frameworkdata-synchronizationazure-data-sync

Sync Framework - Check logic before synchronizing


I'm wondering whether I can sync two databases with some logic.

DbSyncTableDescription user = SqlSyncDescriptionBuilder.GetDescriptionForTable("User", sqlServerConn);
DbSyncTableDescription role = SqlSyncDescriptionBuilder.GetDescriptionForTable("Role", sqlServerConn);
DbSyncTableDescription usersInRoles = SqlSyncDescriptionBuilder.GetDescriptionForTable("UsersInRoles", sqlServerConn);

For example, sync administrators to user table. Do not sync staffs.

enter image description here

Thank in advance!


Solution

  • you can define a filter in your scope... see: Walkthrough: Defining Filtered Scope and Provisioning Server Database

    or if you want more logic around what needs to be synched, you can intercept the changes in the ChangesSelected event...see: Manipulating the change dataset in Sync Fx