The issue status is set to invalid: Dynamic LINQ builds its own IQueryable with its own method invocations, which are transformed to actual IQueryable it "wraps" only on its enumeration or execution (i.e. when either GetEnumerator() or Count()-like extension method is called).
Thus such queryables really can't be processed by our ExecuteXxx methods: there is no way to extract our own underlying IQueryable from them without invoking either GetEnumerator() or Count()-like method on them, that makes such an attempt practically useless.
So the only solution is to avoid using Query.ExecuteXxx methods in this case.
As far as I can judge, there is no such way. Of course, if Dynamic LINQ is capable of returning an expression it produces, or an IQueryable, this must be possible. But I'm not familiar with it so deeply.
Btw, is it really not acceptable to avoid usign ExecuteFutureScalar here? It's just an optimization (and moreover, specific to DO), and you're padding a dynamic query to this method. Normally it's ok to have an additional roundrip to the database in such a case ;) (i.e. with any other ORM you'd have exactly this case).
Any IQueryable has this property - its value describes transformations performed on original queryables to produce this one. I.e. in fact, there is "recorded" sequence of method calls like .Where, that were executed to produce this queryable.
So I'm 99% sure this is not a translated expression, but the original one. To check this, you can call our .ToString(true) extension method on this Expression object.
Err... As far as I can judge, it builds an expression, that is equal to (... as IQueryable).Count() - i.e. the same expression.
So you mean this query really work as future query:
var countFuture = Query.ExecuteFutureScalar(() => (Query.All<FieldType>() as IQueryable).FutureCount());?
answered
Apr 01 '10 at 11:24
Alex Yakunin
2971●4●4●12
Most likely the issue is that IQueryable.Count is really not supported (although IQueryable<t>.Count is supported).
LINQ guys (from our team), could you comment this? Workarounds? What must be done at our side?
Clear - to be fixed.
Issue: http://code.google.com/p/dataobjectsdot ... ail?id=628