动态数据和多对多关系(显示表链接)
我需要开发一个网站以允许用户对数据库执行简单的 CRUD 操作。我认为使用 ASP.NET 动态数据而不是自己实现所有内容是正确的选择。但仍有一些事情我不清楚。
首先,我想使用 LINQ to SQL,因为我以前从未使用过实体框架,并且希望在短时间内提供解决方案。我确实读到 LINQ to SQL 无法解析多对多关系。但如果您使用纯连接表,那么自己实现它应该不成问题。因此,一些额外的属性将被添加到实体类中以在它们之间导航(例如 Product.Orders)。 但是 ASP.NET 动态数据是否能够识别这些附加属性并在网站上显示它们?那么可以隐藏连接表吗?而且相关数据可能会太多。例如,特定产品的订单可能过多,无法直接显示在网站上的产品表中。是否可以只显示“显示相关订单”链接?
使用实体框架可以更轻松地解决我的一些问题吗?我确实读到实体框架能够解决多对多关系,但通常情况下,如果您决定使用另一种技术来执行任务,就会出现其他问题。
感谢您抽出时间。你帮了我很多忙。
I need to develop a web site to allow users to perform simple CRUD operations on a database. I thought that instead of implementing everything by myself, using ASP.NET Dynamic Data would be the right thing. But there are still a few things which are unclear to me.
First I want to use LINQ to SQL because I never used Entity Framework before and want to offer a solution in a short time frame. I did read that LINQ to SQL is not able to resolve Many to Many Relationships. But it should not be a problem to implement it by yourself if you are using Pure Junction Tables which is the case. So a few additional properties will be added to the Entity classes to navigate between them (like Product.Orders).
But is ASP.NET Dynamic Data able to recognize these additional properties to show them on the web site? Is it possible to hide the Junction Tables then? And it will be the case that there is just too many related data. For example there could be too many orders for a specific product to directly display them in the products table on the web site. Is it possible to just show a link "Show related orders" instead?
Could some of my problems easier be solved by using Entity Framework? I did read that Entity Framework is capable of resolving Many to Many Relationships, but it is very often the case that if you decide to use another technology to perform a task other problems will occur.
Thanks for your time. You are helping me a lot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 void DD EF 解决方案作为参考,可以轻松完成将现有 DynamicData 解决方案从 Linq2SQL 迁移到 EF 的过程。
该过程主要涉及页面模板的编辑。
如果有必要,我想我可以给你一些参考:我迁移了我的一个项目以利用自动多对多模板。
F。
The process of migrating an existing DynamicData solution from Linq2SQL to EF can be done easily using a void DD EF Solution as reference.
The process involve mostly the editing of the page templates.
If necessary I think I can give you some reference: I migrated one of my projects to take advantage of the automatic many to many templating.
F.