[ https://issues.apache.org/jira/browse/IGNITE-3325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15334040#comment-15334040 ]
Pavel Tupitsyn edited comment on IGNITE-3325 at 6/16/16 3:53 PM: ----------------------------------------------------------------- There are other corner cases, like using same lambda argument twice in the query. To solve all the limitations once and for all, we should change the API from {code}Compile(Func<T1, IQueryable<T>> query){code} to {code}Compile(Expression<Func<T1, IQueryable<T>>> query){code} This will allow to analyse expression in full detail and substitute arguments in any order, and allow constants. Old methods should be kept to preserve backwards compatibility. was (Author: ptupitsyn): There are other corner cases, like using same lambda argument twice in the query. To solve all the limitations once and for all, we should change the API from {code}Compile(Func<T1, IQueryable<T>> query){code} to {code}Compile(Expression<Func<T1, IQueryable<T>>> query){code} This will allow to analyse expression in full detail and substitute arguments in any order, and allow constants. > .NET: LINQ Take method does not work within CompiledQuery > --------------------------------------------------------- > > Key: IGNITE-3325 > URL: https://issues.apache.org/jira/browse/IGNITE-3325 > Project: Ignite > Issue Type: Bug > Components: community, platforms > Affects Versions: 1.6 > Reporter: Pavel Tupitsyn > Assignee: Pavel Tupitsyn > Fix For: 1.7 > > > User reported that the following code fails with "Error compiling query: all > compiled query arguments should come from enclosing delegate parameters." > {code} > Func<int,int,int,IQueryCursor<ICacheEntry<int, OrderEntity>>> qry = > CompiledQuery.Compile((int x, int y,int z) => > orderCache.AsCacheQueryable().Where(e => e.Value.OrderId % x == z).Take(y)); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)