Some things don't quite make sense here.

On Fri, 2009-08-07 at 09:30 -0700, Dimitryl wrote:
...
> Every time i request this query
> 
> var t = from tb1 in db.Table1
>            select new
>            {
>                   ID = tb1.ID,
>                   Name = tb1.Name,
>                   List = GetTable2(tb1.ID).ToList()
>             };
...
> I get the following exception S0133: Implement QueryMethod
> 'GetTable2'.

GetTable2() is the problem here.  Yet...

> This is the exception and stack trace.
> 
> System.ArgumentException was unhandled
>   Message="S0133: Implement QueryMethod 'ToList'"

ToList() is mentioned here.

So something doesn't quite add up.

That said, given the stack trace I can guess the problem.  When using
IQueryable<T> extension methods, expression trees are used, so your
'select new {...}' is represented as an expression tree which will
contain an Expression.Call() to your GetTable2() method (or .ToList())
method.  DbLinq has special support for some methods within expression
trees (e.g. for DateTime parsing & various other Queryable extension
methods), but DbLinq doesn't know what to do with GetTable2() and
ToList().

I'll need to write up a test and see what Linq-to-SQL does here, but for
the time being this is a DbLinq bug.

 - Jon



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to