Open nicolazreinh opened 4 days ago
DeprovisionAsync(SyncProvision.ScopeInfo)
removes the table itself.
It's literally a DROP TABLE
query that is excuted behind the scene
Just tried with AdventureWorks; and it's seems it's working fine for me:
var remoteOrchestrator = new RemoteOrchestrator(serverProvider, options);
await remoteOrchestrator.DeprovisionAsync(SyncProvision.ScopeInfo);
And ProvisionAsync
is all about creating the tracking table, the stored procedures, the scope info table and the scope info record if needed
IF you ONLY want to remove a ScopeInfo
, you can do it, using the DeleteScopeInfoAsync
method:
var remoteOrchestrator = new RemoteOrchestrator(serverProvider, options);
var scopeInfo = await remoteOrchestrator.GetScopeInfoAsync(scopeName);
await remoteOrchestrator.DeleteScopeInfoAsync(scopeInfo);
IF you want to recreate a scope, you don't have to explicitly create it, just call a ProvisionAsync
that will:
// Create a new setup for a new scope:
var newSetup = new SyncSetup("Customer", "CustomerAddress");
// Provision will create everything needed for this scope and will return the new scope
var newScopeInfo = await remoteOrchestrator.ProvisionAsync("CustomerScope", newSetup);
And finally, if you just want to overwrite an existing scope (without deleting it before) you can use the overwrite thing:
// Create a new setup for a new scope:
var newSetup = new SyncSetup("Address", "Customer", "CustomerAddress");
// Provision will create everything needed for this scope and will return the new scope
var newScopeInfo = await remoteOrchestrator.ProvisionAsync("CustomerScope", newSetup, overwrite:true);
Make sense ?
Description: I am experiencing an issue with updating the scope info using the Dotmim.Sync library. I am using ASP.NET Core Web Proxy with change tracking in SQL Server.
Steps to Reproduce:
Expected Behavior: Calling
DeprovisionAsync
should remove the scope info, andProvisionAsync
withoverwrite
set totrue
should refresh and update the scope info as documented.Actual Behavior:
DeprovisionAsync
does not remove the scope info.ProvisionAsync
withoverwrite
set totrue
retains the old scope info instead of refreshing it.Additional Context:
Any assistance in resolving this issue would be greatly appreciated. Thank you!