2
我正在使用breeze查詢客戶表。我必須實現一個非常複雜的查詢,因此我決定將一個參數傳遞給該方法,並讓服務器進行查詢。問題在於使用方法TAKE的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 修正了微風/ EF錯誤涉及與單個查詢「展開」,「orderBy」和「take」執行不正確的排序。
我已經找到微風頁面,問題已修復,但我有最後一個版本,它仍然不能很好地與TAKE。
似乎'.withParameters:{'':searchText};'無效的代碼 – rab
這是一個錯誤,試圖寫一個簡單的例子我的問題。 – jvrdelafuente
問題不在於,它調用了服務器中的方法,它返回了答案。 – jvrdelafuente