Table of Contents

Class AliasesContext

Namespace
LinqToDB.Internal.SqlQuery
Assembly
linq2db.dll
public sealed class AliasesContext
Inheritance
object
AliasesContext
Extension Methods

Methods

GetAliased()

public IReadOnlyCollection<IQueryElement> GetAliased()

Returns

IReadOnlyCollection<IQueryElement>

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

column SqlColumn

Returns

string

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

field SqlExpressionBase

Returns

string

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

tableSource SqlTableSource

Returns

string

GetUsedTableAliases()

public HashSet<string> GetUsedTableAliases()

Returns

HashSet<string>

RegisterAliased(IQueryElement)

public void RegisterAliased(IQueryElement element)

Parameters

element IQueryElement

RegisterAliased(IReadOnlyCollection<IQueryElement>)

public void RegisterAliased(IReadOnlyCollection<IQueryElement> elements)

Parameters

elements IReadOnlyCollection<IQueryElement>

SetColumnAlias(SqlColumn, string?)

public void SetColumnAlias(SqlColumn column, string? alias)

Parameters

column SqlColumn
alias string

SetFieldName(SqlExpressionBase, string)

public void SetFieldName(SqlExpressionBase field, string name)

Parameters

field SqlExpressionBase
name string

SetTableAlias(SqlTableSource, string)

public void SetTableAlias(SqlTableSource tableSource, string alias)

Parameters

tableSource SqlTableSource
alias string