Closed SimonCropp closed 1 day ago
@roji thanks for the clarrification.
to get the table referenced by a ColumnExpression, an expression visitor must track the tables in scope as it visits SelectExpression, and then use that state information to resolve the ColumnExpression's table alias to the TableExpressionBase it refers to.
awesome. that got me moving forward
And also, how were you using ColumnExpression.Table previously?
we have some code that forces tolists to have an orderby in certain circumstances. similar to the "filter must have an order by" warning already in ef
Thanks for the context @SimonCropp, don't hesitate to ping me back for any further questions etc.
ColumnExpression no longer references its table - it only has the table and column aliases, and in that sense, accurately represents the actual SQL syntactic element (which is e.g.
t.Id
). The previous system meant that our expression tree was in fact a graph (since the table was referenced by both the SelectExpression and columns), and caused lots of referential integrity bugs as references were not kept in sync etc.To get the table referenced by a ColumnExpression, an expression visitor must track the tables in scope as it visits SelectExpression, and then use that state information to resolve the ColumnExpression's table alias to the TableExpressionBase it refers to.
Does that make sense? And also, how were you using ColumnExpression.Table previously?