A scope is an object that defines a specific synchronization setup and its database schema. It is identified by a unique name and contains a list of tables to be synchronized.
Scopes are persisted in a metadata table (defaulting to scope_info) on both the Server and all Client data sources. This allows the synchronization engine to track what has been synchronized and what the schema looks like for specific groups of tables.
You can define multiple scopes to handle different synchronization scenarios, such as:
- A
"products" scope containing only product-related tables. - A
"customers" scope containing only customer and order tables. - A default scope (named
"DefaultScope") containing all tables.
// Example of defining a setup that will be part of a scope
var setup = new SyncSetup("ProductCategory", "ProductModel", "Product",
"Address", "Customer", "CustomerAddress", "SalesOrderHeader", "SalesOrderDetail" );
var agent = new SyncAgent(clientProvider, serverProvider);
var s1 = await agent.SynchronizeAsync(setup);