I've a N-tier Sync Framework application that has a WCF Service hosted on Azure and clients running a small WPF client. These clients sync their local SQL Server Express database with a SQL Database on Azure using the WCF Service. So from the WPF app the SyncOrchestrator uses a SqlSyncProvider (LocalProvider) and a RelationalProviderProxy (RemoteProvider) via a Proxy. Provisioning is done manually on server using the SyncSvcUtilUI from Microsoft and is applied on clients at runtime. It works like a charm!
But now I need to add filters. So clients can choose what Customers they want to sync. They have a simple drop-down to choose client's location (let's say only clients from NY) and then I would apply these filters and Sync. So that's what I'm doing right now:
The problem? I've to execute a deprovision of both client and server EACH TIME before syncing, losing tracking and sending all the data again and again. And that's my problem. I can't believe that there is no other way around. Or am I missing something? I need to work with filters and they need to be dynamic.
Please, if anyone has some tips about a better way to do it, I would really appreciate (I'm all ears) :)
Thanks!!
there is no support for dynamic filtering in Sync Fx (partition realignment or rows going in and out of scope).
the suggested way is to deprovision and re-initialize the client.
you can try overriding the sync provider and building the filter query yourself (see approach here for overriding the query).
bringing a row in scope (the row qualifies in the filter condition) is easy. but you will have to deal separately with rows going out of scope (the row has been synched to a client, but the filter condition was modified so the row isnt supposed to be at the client)