This question is locked. New answers and comments are not allowed.
Hello,
We have Sybase ASE as our backend database and we have struggled to find a good LINQ provider. We finally arrived at http://bltoolkit.net/ which has been a fantastic solution for us. The trouble is that the implementation of the Count function in the Telerik QueryableExtensions uses System.Linq.IQueryProvider.Execute and casts the result to int. The bltoolkit that we are using does not currently have full support for that method. It does however have full support for System.Linq.IQueryProvider.Execute<TResult>. I believe the Telerik method would work better if they called an execute that is strongly typed, instead of asking for an object and then casting it back to an int.
would become
Thanks so much for your time and consideration.
We have Sybase ASE as our backend database and we have struggled to find a good LINQ provider. We finally arrived at http://bltoolkit.net/ which has been a fantastic solution for us. The trouble is that the implementation of the Count function in the Telerik QueryableExtensions uses System.Linq.IQueryProvider.Execute and casts the result to int. The bltoolkit that we are using does not currently have full support for that method. It does however have full support for System.Linq.IQueryProvider.Execute<TResult>. I believe the Telerik method would work better if they called an execute that is strongly typed, instead of asking for an object and then casting it back to an int.
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 },
new
Expression[] { source.Expression }));
}
would become
public
static
int
Count(
this
IQueryable source)
{
if
(source ==
null
)
{
throw
new
ArgumentNullException(
"source"
);
}
return
source.Provider.Execute<
int
>(Expression.Call(
typeof
(Queryable),
"Count"
,
new
Type[] { source.ElementType },
new
Expression[] { source.Expression }));
}
Thanks so much for your time and consideration.