VD
unread,Oct 22, 2010, 6:00:06 AM10/22/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DbLinq
Hi,
I have faced with a problem when I used class with property "Count".
When I use this property in orderby clause, it generates to wrong
query: SELECT ... FROM ... ORDER BY SELECT COUNT(*). I discovered, why
it happend. There is some strange code: the class ExpressionDispatcher
(DbLinq.Data.Linq.Sugar.Implementation namespace), method
AnalyzeMember(Expression expression, BuilderContext builderContext)
contains chek:
if (!isStaticMemberAccess && memberInfo.Name == "Count")
return
AnalyzeProjectionQuery(SpecialExpressionType.Count, new[]
{ memberExpression.Expression }, builderContext);
This code leads to the described above problem. Can somebody describe
to me what this code means, and for what reasons it was written? If I
understood the logic, Count expression never can be a
MemberExpression, it is a CallExpression. As I know linq it doesn't
contain expression like "select someTable.count()".. Mey be it is bug?
Thanks.