Breeze 1.4.6-分页后应用投影查询的inlinecount
在升级到针对WebAPI2的Breeze1.4.6之后,我相信在分页之后会应用投影查询的inlinecount 例如,如果我指定take(5),那么inlinecount返回5,即使过滤器匹配100条记录 您能确认这是breeze 1.4.6的问题吗? 查看QueryHelper中的代码,看起来只有当odata查询被修改为支持“选择”或“嵌套”属性时才会发生这种情况 我已经能够在失败的单元测试中重现问题:Breeze 1.4.6-分页后应用投影查询的inlinecount,breeze,Breeze,在升级到针对WebAPI2的Breeze1.4.6之后,我相信在分页之后会应用投影查询的inlinecount 例如,如果我指定take(5),那么inlinecount返回5,即使过滤器匹配100条记录 您能确认这是breeze 1.4.6的问题吗? 查看QueryHelper中的代码,看起来只有当odata查询被修改为支持“选择”或“嵌套”属性时才会发生这种情况 我已经能够在失败的单元测试中重现问题: /********************************************
/*********************************************************
* inlineCount of projected paged products
*********************************************************/
test("inlineCount of projected paged products", 2, function () {
// Filtered query
var productQuery = EntityQuery.from("Products")
.where("ProductName", "startsWith", "C");
// Paging of that filtered query ... with inlineCount
var pagedQuery = productQuery
.select("ProductName, Category.CategoryName")
.orderBy("ProductName")
.skip(5)
.take(5)
.inlineCount();
var productCount, pagedCount, inlineCount;
var em = newEm();
stop(); // going async
// run both queries in parallel
var promiseProduct =
em.executeQuery(productQuery)
.then(function (data) {
productCount = data.results.length;
});
var promisePaged =
em.executeQuery(pagedQuery)
.then(function (data) {
pagedCount = data.results.length;
inlineCount = data.inlineCount;
});
Q.all([promiseProduct, promisePaged])
.then(function () {
ok(inlineCount,
"'data' from paged query should have 'inlineCount'");
equal(inlineCount, productCount,
"'inlineCount' should equal product count");
})
.fail(handleFail)
.fin(start);
});
非常欢迎使用修复程序:-)不确定您正在寻找什么修复程序。从Breeze文档(我添加了突出显示)—— 内联计数整数- 仅当“inlineCount(true)”应用于查询时可用。返回在应用任何skip或take运算符之前,但在应用任何筛选器/where谓词之后,查询将返回的项的计数 更新: 这已在Breeze 1.4.7版本中修复,现已发布 以前的职位
这是Breeze1.4.6中涉及select和INLINECUNT的一个错误。它已经在GitHub上的源代码和dll中修复。(您可以继续并直接拉dll)。这个补丁也将在下周的某个时候发布在1.4.7版本中 你说得对,我的错。我需要纠正我的问题。我应该说inlinecount是在应用分页之后应用的。例如,如果我要求取(10),那么即使过滤器匹配100条记录,inlinecount也会返回10