Unsupported overload used for query operator 'Where'

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
crazypit
Posts: 163
Joined: Wed 15 Apr 2009 08:43

Unsupported overload used for query operator 'Where'

Post by crazypit » Mon 01 Mar 2010 10:07

Hello all,

I use the latest stable version of dotConnect for Oracle.
I need to dynamically create LINQ queries through Expressions. So, i start with the simple query :

IQueryable query =
from objCustomerInfo in context.CustomerInfos
where objCustomerInfo.Datt == null
select objCustomerInfo;

I need to apply a Where clause dynamically using the following expressions :
System.Linq.Expressions.Expression> predicate = b => b.UdfId == udfId;
System.Linq.Expressions.Expression> predicate2 = a => (context.UdfsValues.Where(predicate).Select(b => b.RefId)).Contains(a.Id)

Finally i use the Expression like that:
var result = query.Where(predicate2).ToList();

When the ToList() is called, i get the following exception:
Exception message: {"Unsupported overload used for query operator 'Where'."}
Stack Trace: at Devart.Data.Linq.Provider.Query.bk.b(MethodCallExpression A_0)
at Devart.Data.Linq.Provider.Query.bk.j(Expression A_0)
at Devart.Data.Linq.Provider.Query.bk.d(Expression A_0, Expression A_1)
at Devart.Data.Linq.Provider.Query.bk.b(MethodCallExpression A_0)
at Devart.Data.Linq.Provider.Query.bk.j(Expression A_0)
at Devart.Data.Linq.Provider.Query.bk.i(Expression A_0, Expression A_1)
...................................

It's just a simple variable usage. If i don't use the variables, and i set the lambda expressions directly, everything works ok.

crazypit
Posts: 163
Joined: Wed 15 Apr 2009 08:43

Post by crazypit » Tue 02 Mar 2010 08:39

Anything new on this???

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 03 Mar 2010 10:04

I have checked this query in Microsoft LINQ to SQL. It throws the same exception.
The problem seems to be associated with the predicate expression.

crazypit
Posts: 163
Joined: Wed 15 Apr 2009 08:43

Post by crazypit » Wed 03 Mar 2010 11:42

I don't understand, is this a bug or is there something wrong with what i wrote?
Can i expect a fix on this by Devart? Is there a workaround?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 03 Mar 2010 12:39

This is a limitation of Microsoft LINQ to SQL.
We will investigate the possibility to solve this problem.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 15 Mar 2010 10:46

We have added support for this scenario in the upcoming build of dotConnects.

crazypit
Posts: 163
Joined: Wed 15 Apr 2009 08:43

Post by crazypit » Mon 15 Mar 2010 10:59

Nice! Thanks!

Post Reply