gpt4 book ai didi

c# - 在 .NET Core 3 下的 EF 中,我还需要一个显式的中间实体吗?

转载 作者:行者123 更新时间:2023-12-04 11:33:13 25 4
gpt4 key购买 nike

我读过几篇类似 this one 的文章其中暗示 A 和 B 之间显式实体 AB 的必要性。

当我谷歌这个时,我找不到任何官方信息确认或反驳该声明。另一方面,预览版本的文档可能没有完全覆盖。

在 .NET Core 3 中是否可行,还是我们仍然被迫手动创建 N 对 N 实体?

最佳答案

您(不仅是)要求的功能由 #10508: Implement many-to-many relationships without mapping join table 跟踪.

如您所见,状态为 Backlog ,这意味着它被考虑,但没有具体的时间表。还有 last comment由 EF Core 团队(经理)是

Current plan for 3.0 is to implement skip-level navigation properties as a stretch goal. If property bags (#9914) also make it into 3.0, enabling a seamless experience for many-to-many could become easier.



它也没有列在 New features 中.并且刚刚在 Property bag entities 中引用

This feature is a stepping stone to support many-to-many relationships without a join entity (issue #1368), which is one of the most requested improvements for EF Core.



其中#1368 指的是 Discussion on many-to-Many relationships (without CLR class for join table) .

所有这一切仅仅意味着您的问题的答案是 - 不,此功能不会出现在 3.0 中,因此您应该继续使用显式连接实体。

关于c# - 在 .NET Core 3 下的 EF 中,我还需要一个显式的中间实体吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57118266/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com