开发者

Predicate in RavenDB dynamic query not working correctly

开发者 https://www.devze.com 2023-03-18 19:29 出处:网络
Consider the 2 queries: var test1 = store.OpenSe开发者_如何转开发ssion().Query<TestClass>().Where(x => x.Id == 1).ToList();

Consider the 2 queries:

   var test1 = store.OpenSe开发者_如何转开发ssion().Query<TestClass>().Where(x => x.Id == 1).ToList();
   var test2 = store.OpenSession().Query<TestClass>().Where(x => x.Id >= 1).ToList();

test1 returns 1 item in the list. test2 returns 0 items.

For some reason I can't get it to return any items in the 2nd query. Is there any reason for this?


Ok, so as commented I created a failing test for this and sent it through to ayende for comment.

https://github.com/ravendb/ravendb/issues/337

The answer is that it was not currently supported, but ayende has made some changes to support it.

https://github.com/ayende/ravendb/commit/f6beb4f9d8c763c3eb37f93fed84c657e0f207fb

Though reading that commit comment, I am not sure he is happy about it :)

So if you need it now, you are going to have to go to source, otherwise it will make it into a future stable build.

0

精彩评论

暂无评论...
验证码 换一张
取 消