如何将我的数据访问方法连接到我的 asp.net UI?

发布于 2024-08-24 05:02:36 字数 461 浏览 1 评论 0原文

我在这里严重不知所措。在此项目中不会改变的三件事是:我们使用实体框架进行数据访问、我们想要彻底的单元测试以及我们的 UI 是 asp.net。我的问题是你到底是如何在 Asp.net 中实现这个功能的?

例如,您可以使用 ObjectDataSource 将方法连接到控件,但如果此控件是 FormView,则您会遇到所有这些问题 http://vaultofthoughts.net/ProblemsWithObjectDataSource.aspx 来处理,但它根本不起作用。

此外,对于网格,除非您使用基本上绕过整个应用程序的 EntityDataSource,否则您无法立即进行分页或排序。我不可能是唯一一个为此哭泣的人。你做什么工作?

提前致谢。

I am seriously at a loss here. The three things that will not change in this project are the fact that we are using the Entity Framework to do our data access, the fact that we want thorough unit testing and that our UI is asp.net. My question is how the hell do you make this work in Asp.net?

E.g. You can use an ObjectDataSource to connect a method to a control, but if this control is a FormView you have all these problems http://vaultofthoughts.net/ProblemsWithObjectDataSource.aspx to deal with and it simply doesn't work.

Furthermore, with grids, you don't get paging or sorting out of the box unless you use an EntityDataSource which basically circumvents your entire application. I can't be the only person who cries at this. What do you do?

Thanks in advance.

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

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

发布评论

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

评论(1

画骨成沙 2024-08-31 05:02:37

不确定你的问题是什么,但无论如何!您是否在使用 EntityFramework 时遇到问题,因为我知道维护 ObjectContext/DataContext 可能很困难。通常,对于 ASP.NET 应用程序,您在 HttpContext 中维护 ObjectContext。

对于分页和排序,您可以创建自定义网格或使用任何具有分页和排序功能的第三方网格。

Not sure what your question is here but anyways! Are you having problems with EntityFramework because I know that maintaining the ObjectContext/DataContext can be hard. Usually, with ASP.NET applications you maintain the ObjectContext inside the HttpContext.

For paging and sorting you can create a custom Grid or use any of the third party grids that have paging and sorting functionality.

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