gpt4 book ai didi

javascript - 在 Breeze 中使用 'take' 方法查询时可能出现的错误

转载 作者:行者123 更新时间:2023-11-29 22:12:54 26 4
gpt4 key购买 nike

我正在使用 breeze 查询客户表。我必须实现一个非常复杂的查询,所以我决定将一个参数传递给该方法并让服务器进行查询。问题是使用 BREEZE 的方法 TAKE 服务器返回的客户列表与服务器。

我做了一些测试,当我使用 BREEZE 的 TAKE 方法时,只有这个顺序被改变了。这是我在服务器和客户端中的一些代码:

//CLIENT
function(searchText,resultArrayObservable, inlineCountObservable){

query = new breeze.EntityQuery("CustomersTextSearch");
.skip(0)
.take(30)
.inlineCount(true)
.withParameters({ '': searchText});

return manager.executeQuery(query).then(function(data){
//The data results are not in the same order as the server resturn.
inlineCountObservable(data.inlineCount);
resultArrayObservable(customerDto.mapToCustomerDtos(data.results));
});
}


//SERVER ASP.NET WEB API
[HttpGet]
public IQueryable<Customer> CustomersTextSearch(string textSearch = "")
{
//Here, customers has the rigth order.
var customers= _breezeMmUow.Customers.GetBySearchText(textSearch, CentreId);
return customers;
}

也许不是BUG,也许是我做的不对。有人可以帮助我吗?

------------编辑------------

1.3.2修复了涉及使用“expand”、“orderBy”和“take”执行错误排序的单个查询的 Breeze/EF 错误。

我在 breeze 页面中发现问题已解决,但我使用的是最新版本,但它仍然不能很好地与 TAKE 配合使用。

最佳答案

这是一个错误,已在 Breeze v 1.3.6 中修复,现在可用。

关于javascript - 在 Breeze 中使用 'take' 方法查询时可能出现的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17083679/

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