我在客户端使用以下查询:BreezeJS不执行数据库中的过滤?
var query = breeze.EntityQuery.from("AllCustomers").where("CustomerId,"==",criteriaValue);
return this.manager.executeQuery(query)
导致以下网址: /breeze/myAPI/AllCustomers?$filter=CustomerId%20eq%2012
我注意到,过滤未在数据库中执行的(没有WHERE statemenet在由数据库执行的SQL中)。我怀疑,原因是Breeze.WebApi.QueryHelper.WrapResult
,其中调用Enumerable.ToList
。后来皈依IQueriable列出其是否是默认微软的OData实现过滤之前强制执行查询:
// if a select or expand was encountered we need to
// execute the DbQueries here, so that any exceptions thrown can be properly returned.
// if we wait to have the query executed within the serializer, some exceptions will not
// serialize properly.
queryResult = Enumerable.ToList((dynamic)queryResult);
queryResult = PostExecuteQuery((IEnumerable)queryResult);
这是在微风中的错误还是我做错了什么?
我正在使用Oracle ODP.NET提供程序实体框架。
UPDATE:我使用的WebAPI和控制器方法非常简单:
[BreezeController]
public class MyController : ApiController
{
[HttpGet]
public IQueryable<Customer> AllCustomers()
{
return _contextProvider.Context.Customers;
}
谢谢。修复的承诺是什么? https://github.com/IdeaBlade/Breeze/commit/c94b20d5141c72b8295b179b93638a70670133f6? – matra
只要采取最新的措施,我们会尽力确保它始终保持清洁。请注意,在我们发布之前它仍将标记为1.4.2。 –
我明白这一点。我只是好奇,修补程序是什么,因为我无法自己修复它:-) – matra