我在客戶端使用以下查詢: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