动态数据:对于使用视图而不是表的 LINQ 类,支架是只读的?

发布于 2024-07-09 16:57:01 字数 248 浏览 10 评论 0原文

我正在尝试使用 ASP.NET 动态数据功能为我的数据模型生成 CRUD 脚手架。 我的模型包含超类型/子类型关系,因此一些逻辑实体分为两个表:一张用于通用数据,一张用于特定于子类型的数据。

在 LINQ 上下文中,我将这些实体公开为单个类,并由将表连接在一起的视图支持。 我还为插入/更新/删除创建了存储过程,并配置了类行为以使用它们。

当我打开脚手架时,它仅生成此数据的只读视图。 添加、编辑和删除链接不会显示。 为什么?

I am trying to use the ASP.NET Dynamic Data features to generate CRUD scaffolding for my data model. My model contains supertype/subtype relationships, so some logical entities are split between two tables: one for the generic data and one for the subtype-specific data.

In the LINQ context I expose these entities as a single class, backed by a view that joins the tables together. I have also created sprocs for insert/update/delete and configured the class behaviour to use them.

When I turn on scaffolding, it only generates a read-only view of this data. The add, edit and remove links don't show up. Why?

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

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

发布评论

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

评论(1

白芷 2024-07-16 16:57:01

已解决:问题是在将视图拖到表面上后,我没有识别 LINQ 类上的主键列。 添加 PK 后,CRUD 功能就出现了。

SOLVED: The problem was that I did not identify a Primary Key column on the LINQ classes after dragging the views onto the surface. After adding a PK the CRUD functions showed up.

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