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

时间:2013-06-13 09:31:01

标签: javascript breeze

我正在使用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,也许我做错了什么。有人可以帮帮我吗?

------------- ------------- EDIT

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

我在微风页面中发现问题已修复,但我有最后一个版本,并且仍然无法正常使用 TAKE

1 个答案:

答案 0 :(得分:2)

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

相关问题