gpt4 book ai didi

c# - QueryObject 包含 Entity Framework

转载 作者:太空宇宙 更新时间:2023-11-03 16:58:13 24 4
gpt4 key购买 nike

<分区>

我有三个表:Scenarios、Components 和 Blocks。 Blocks 有一个指向 ComponentId 的外键,而 Components 有一个指向 Scenarios 的外键。

Blocks 也有一个到另一个表 TreeStructures 的外键 (TreeStructureId)。

现在,为什么会这样:

ObjectQuery<Blocks> blocks = edumatic3Entities.Blocks.Include("TreeStructures").Include("Components.Scenarios");

它加载树结构、组件和场景。

但这不起作用:

ObjectQuery<Blocks> blocks = edumatic3Entities.Blocks.Include("Components.Scenarios").Include("TreeStructures");

这会加载组件和场景,但不会加载 TreeStructures...

我觉得很奇怪...这是为什么?

谢谢,列文·卡登

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