Hi, I´ve been working with DbLinq for a while now, and recently using DbLinq, Dynamic Linq and SQLite I programmed a call to the Count method of a Queryable object. public static int Count(this IQueryable source)
{
if (source == null) throw new ArgumentNullException
("source");
return (int)source.Provider.Execute(
Expression.Call(
typeof(Queryable), "Count",
new Type[] { source.ElementType },
source.Expression));
}
When doing so against a DbLInq Table object the following method is called:
public object Execute(Expression expression)
{ .... }
the problem is that the function calls the generic Execute method inside
the same class with the generic argument of type: object:
"Execute<object>(expression)" which causes an invalid cast exception in the
case I´m talking about, and potentially any call to this method could fail
when the expression evaluation creates a generic type.
I´ve downloaded the code and changed the method so it makes the call based
on the expression Type using reflection to create the proper call.
I have a attached a patch that will solve this issue.
I have executed the unit tests for DbLInq and SQLite provider and the
results were equal before and after applying the patch, as you can see in
the attached images.
If someone can run the rest of the tests and give be feedback I would really
appreciate it.
Any Comments???
Thanks for such a great tool.
Logo HexaSystems 408x180
Carlos Mendible
Project Manager
mobile: +34 663 47395
email: <mailto:[email protected]>
[email protected]
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
<<inline: image001.jpg>>
DbLinq.patch
Description: Binary data
<<attachment: AfterPatch.jpg>>
<<attachment: BeforePatch.jpg>>
