使用 Microsoft Sync Framework 过滤数据
背景:我正在开发一个使用离线应用程序架构的项目。我们的客户端程序有两种模式:连接和断开。当用户处于断开连接模式时,他们将使用本地数据库(SQL CE)来检索和存储数据。当用户再次连接到应用服务器时,本地数据库也会与中央数据库同步。本项目中的传输层是WCF,我们实现一个代理类来在客户端公开SQLSyncProvider,以便Sync Framework 同步数据。
问:如何使用 MSF 实现数据过滤?在我们的项目中,每个客户端都有一个角色,每个角色都可以访问不同数量的表以及表中的行。据我所知,MSF允许我们使用参数列过滤数据,但是,对用户的规定将是相同的。就我而言,每个用户的规定都会有所不同,这取决于用户的角色。
谢谢。
Context: I'm working on a project that use Offline Application Architecture. Our client program has 2 modes: connected and disconnected. When user in disconnected mode, they will use their local database (SQL CE) for retrieving and storing data. When user connects to application server again, the local database will be synchronized with central database as well. The transport layer in this project is WCF, we implement a proxy class to expose SQLSyncProvider on client for Sync Framework to sync data.
Question: How could I implement data filtering with MSF? In our project, each client will has a role, and each role will have access to different number of tables as well as rows in table. As far as I know, MSF allows us to filter data with a parameter column however, the provision for users will be same. In my case, the provision for each user will be so different, it depends on user's role.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在服务器端使用适配器过滤器,并且可以发送一些参数以从客户端获取客户端数据。
客户
this.Configuration.SyncParameters.Add(
new SyncParameter("@CustomerName", "Sharp Bikes"));
服务器
SqlSyncAdapterBuilder
You can use adapter filters on server side, and can send some parameter to fetch data on client bases from client.
Client
this.Configuration.SyncParameters.Add(
new SyncParameter("@CustomerName", "Sharp Bikes"));
Server
SqlSyncAdapterBuilder