0

在微风.js 中不支持使用 select 扩展:

breeze.EntityQuery.from("TagConnections")
                  .expand("ttQuestions").where("QuestionID", "!=", null)
                  .select("ttQuestions"); // not possible

有解决方法吗?

我可以在查询结果上获取/运行查询/选择吗?

4

2 回答 2

1

我找到了一种解决方法:

// client:
breeze.EntityQuery.from("Questions")
              .withParameters({ myParameter: "any addional query information" });

// server:
public IQueryable<ttQuestions> Questions(string myParameter=null)
{
    // handle parameters here
    ...
}
于 2013-07-27T11:38:21.633 回答
1

首先,这不是 Breeze 的缺陷或限制。EntityFramework 不支持 select 和 expand 的组合。Breeze 可以为您提出问题,但由服务器来交付货物。在这种情况下,EF无法发货。

@zoidbergi - 在您的示例中,我没有完全看到“解决方法”。我的猜测是您在不使用扩展的情况下执行查询。更重要的是,您已将查询修改为以 . 为目标Questions,这是您真正想要的,而不是TagConnections.

我怀疑您缺少什么……我们中的许多人也想拥有它……是表达“任何”条件的能力。如果可用,您可以查询与满足您的过滤条件Questions的任何相关联的那些。TagConnections您可以在服务器上的 EF 中编写这样的查询。不幸的是,您还不能在 BreezeJS 中编写该查询。

于 2013-07-28T06:29:56.140 回答