Class AliasesContext
public sealed class AliasesContext
- Inheritance
-
objectAliasesContext
- Extension Methods
Methods
GetAliased()
public IReadOnlyCollection<IQueryElement> GetAliased()
Returns
GetColumnAlias(SqlColumn)
Effective column alias: the finalized alias recorded by the aliasing pass, otherwise derived from the column's expression - resolving sub-expression aliases through this context so finalized names are honoured (mirrors SqlColumn's own derivation, but context-aware). This is the crux of non-mutating aliasing: derivation must read finalized names, not stale nodes.
public string? GetColumnAlias(SqlColumn column)
Parameters
columnSqlColumn
Returns
GetFieldName(SqlExpressionBase)
Effective field physical name: the finalized name recorded by the aliasing pass (for
derived-table / CTE source fields), otherwise the field's own physical name -
PhysicalName for a table field, the finalized name of its
definition field for a CTE reference field (CteField), or
the delegated Name for a CTE definition field (SqlCteField).
public string GetFieldName(SqlExpressionBase field)
Parameters
fieldSqlExpressionBase
Returns
GetTableAlias(SqlTableSource)
Effective table-source alias: the finalized alias recorded by the aliasing pass, otherwise derived from the node - resolving a nested table source through this context so finalized names are honoured (mirrors SqlTableSource's own derivation, but context-aware).
public string? GetTableAlias(SqlTableSource tableSource)
Parameters
tableSourceSqlTableSource
Returns
GetUsedTableAliases()
public HashSet<string> GetUsedTableAliases()
Returns
RegisterAliased(IQueryElement)
public void RegisterAliased(IQueryElement element)
Parameters
elementIQueryElement
RegisterAliased(IReadOnlyCollection<IQueryElement>)
public void RegisterAliased(IReadOnlyCollection<IQueryElement> elements)
Parameters
elementsIReadOnlyCollection<IQueryElement>
SetColumnAlias(SqlColumn, string?)
public void SetColumnAlias(SqlColumn column, string? alias)
Parameters
SetFieldName(SqlExpressionBase, string)
public void SetFieldName(SqlExpressionBase field, string name)
Parameters
fieldSqlExpressionBasenamestring
SetTableAlias(SqlTableSource, string)
public void SetTableAlias(SqlTableSource tableSource, string alias)
Parameters
tableSourceSqlTableSourcealiasstring