具有一组通用 CRUD 方法的 WCF/RIA

发布于 2024-10-02 05:56:08 字数 514 浏览 0 评论 0原文

我对 WCF/RIA 服务非常陌生。我希望使用 PRISM/MEF 构建一个应用程序,我可以不时为该应用程序提供新的插件。现在,我的数据库结构几乎是静态的。它在其生命周期中不会发生太多变化(但仍然可能会有一些变化)。新插件将使用数据库公开的实体类。

我的问题是,当我创建新的插件控件时,这些控件可能需要一些特殊的服务器端方法才能运行。这意味着我更新我的 WCF/RIA 服务以适应新方法。我真的想避免这种情况,并且想知道是否可以创建一个只有 4 个 CRUD 方法的 WCF 服务。我可以将任何实体传递给这些方法,并根据类型保存、更新或删除实体。它还允许我将任何类型的 LINQ 查询传递给 get 方法并返回适当的结果。目标是避免对 WCF 服务进行更改,除非底层数据库结构发生更改。

无论我向插件添加什么特殊方法,它们都可能只是意味着将复杂的 LINQ 查询传递给通用 Get 方法并在客户端获取结果。大多数实体管理发生在客户端。 WCF 成为数据库上的一个简单(但功能强大)层,使我可以访问任何实体并处理基于客户端 LINQ 查询的任何复杂查询。

谢谢, 中号

I am very new to WCF/RIA services. I am looking to build an application using PRISM/MEF where I can offer new plug-ins for the application from time to time. Now, my database structure is pretty much static. It will not see many changes during its life (but there still might be a few). The new plug-ins will use the entity classes exposed by the database.

My Question is when I create new plug-in controls, these controls might need some special server side methods to be run. Which would mean I update my WCF/RIA service to account for the new methods. I really want to avoid that and was wondering if it is possible to create a WCF service that has just 4 CRUD mehods. I can pass any entity to these methods and depending upon the type, the entity gets saved, updated or deleted. Also it lets me pass any kind of LINQ query to the get method and returns me the appropriate results. The goal is to avoid making changes to WCF service unless the underlying DB structure changes.

Whatever special methods I add to my plug-in, they could simply mean passing complex LINQ queries to the generic Get method and get the results on the client side. Most of entity management happens on the client. WCF becomes a simple (yet powerful) layer over my database that lets me access any entity and process any complex query based on client side LINQ queries.

Thanks,
M

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

む无字情书 2024-10-09 05:56:08

将这 4 个 CRUD 操作放在单独的域服务中。

Have these 4 CRUD operations in a seperated Domain Service.

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