-
Notifications
You must be signed in to change notification settings - Fork 934
NH-3800 and NH-3681 #433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NH-3800 and NH-3681 #433
Conversation
if (index == null) | ||
return visitedExpression; | ||
|
||
var expressionList = expression.Left as NewArrayExpression; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add check that this is a NewArrayInit
and not NewArrayBounds
@PleasantD can you please update the pull request according to CONTRIBUTING.md. Eg, tabs instead of spaces |
Done and done! Is there anything else I can do to expedite the release of this and #432? |
TransparentIdentifierRemovingExpressionTreeVisitor (doing the same as you did with arrays, but for anonymous types) also visits SubQueryExpression, can you investigate, if we need so? |
@PleasantD also, can you squash your commits? |
@@ -31,7 +31,7 @@ private GroupBySelectClauseRewriter(GroupResultOperator groupBy, QueryModel mode | |||
|
|||
protected override Expression VisitQuerySourceReferenceExpression(QuerySourceReferenceExpression expression) | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably need to add
if (!IsMemberOfModel(expression))
{
return base.VisitQuerySourceReferenceExpression(expression);
}
If necessary
- Added issue specific tests - Modifed the GroupBySelectClauseRewriter to dig a bit deeper to match the group result ElementSelector - Modifed the GroupBySelectClauseRewriter to allow member access of convert expressions - Added a step to the QueryModelVisitor to flatten array index expressions with constant indexers to the inner expression
@hazzik regarding the ArrayIndexExpressionFlattener needing to visit SubQueryExpressions I wrote an example test and found that the initial pass wasn't flattening the array access, but then QueryModelVisitor.GenerateHqlQuery gets called on the subquery by HqlGeneratorExpressionTreeVisitor, causing the array indexes to be flattened on the second pass. If the SubQueryExpression query model is flattened by the initial pass, then the same result occurs. |
NH-3681 - Allow the GroupBySelectClauseRewriter to correctly match the group by elements NH-3800 - Unwrapping constant ArrayIndex expressions to their inner expressions
Fixes NH-3681 by allowing the GroupBySelectClauseRewriter to correctly match the group by elements.
Fixes NH-3800 by unwrapping constant ArrayIndex expressions to their inner expressions.