繁体   English   中英

Breeze.js用select扩展

[英]Breeze.js Expand with select

没有支持在breeze.js中使用expand和select:

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

有解决方法吗?

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

我找到了一个解决方法:

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

// server:
public IQueryable<ttQuestions> Questions(string myParameter=null)
{
    // handle parameters here
    ...
}

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

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

我怀疑你错过了什么......我们中的许多人也希望拥有它...是表达“任何”条件的能力。 如果可用,您可以查询与满足您的过滤条件的任何TagConnections相关联的那些Questions 您可以在服务器上的EF中编写此类查询。 不幸的是,你还不能在BreezeJS中编写那个查询。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM