使用 Microsoft Sync Framework 过滤数据

发布于 2024-10-02 14:16:32 字数 336 浏览 1 评论 0原文

背景:我正在开发一个使用离线应用程序架构的项目。我们的客户端程序有两种模式:连接和断开。当用户处于断开连接模式时,他们将使用本地数据库(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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吃兔兔 2024-10-09 14:16:32

您可以在服务器端使用适配器过滤器,并且可以发送一些参数以从客户端获取客户端数据。

客户
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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文