NonQualifiedNameNames in v188.8.131.524
I have a known column name, and want to find the object in the query that corresponds to that name. The name I have is not qualified but it is qualified in the sql. E.g. I have "Color" and the column in the select is "Product.Color"
I have the QueryColumnListItem-s from the select query, and want to get the unqualified name. In the past I used
CriteriaItem crit = ...
(crit.Expression as SQLExpressionColumn)?.Column?.NonQualifiedNameNames
In v3 I have
QueryColumnListItem crit = ...
//NonQualifiedNameNames doesn't exist, not sure how to use
//(crit.Expression as SQLExpressionColumn).Column.BuildNonQualifiedNameNames
SQLObjectColumn col = (crit.Expression as SQLExpressionColumn)?.Column;
var foo = col?.Items?.FirstOrDefault() as AstToken;
foo?.Token //contains "Color"
I worry this is a bit of a hack and won't work in some circumstances, is there a better way?