【问题标题】:Possible bug when querying using the 'take' method in Breeze在 Breeze 中使用 'take' 方法查询时可能出现的错误
【发布时间】:2013-06-13 09:31:01
【问题描述】:

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

我做了一些测试,只改变了这个顺序,当我使用 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 修复了 Breeze/EF 错误,该错误涉及使用“expand”、“orderBy”和“take”执行错误排序的单个查询。

我在微风页面中发现问题已解决,但我有最新版本,它仍然无法与 TAKE 一起正常工作。

【问题讨论】:

  • 似乎.withParameters : { '': searchText};无效代码
  • 试图为我的问题写一个简单的例子是个错误。
  • 问题不在于,调用了服务器中的方法,它返回了正确的答案。
  • 我们能够重现该问题,它似乎是一个错误。我们正在进一步调查。

标签: javascript breeze


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2013-04-12
    • 2017-08-14
    • 2015-02-14
    • 1970-01-01
    • 2020-11-16
    • 1970-01-01
    • 2022-01-20
    • 1970-01-01
    • 2018-06-17
    相关资源
    最近更新 更多