Table of Contents

Class SqlTableSource

Namespace
LinqToDB.SqlQuery
Assembly
linq2db.dll
public class SqlTableSource : ISqlTableSource, ISqlExpression, IQueryElement, IEquatable<ISqlExpression>, ISqlExpressionWalkable
Inheritance
SqlTableSource
Implements
Extension Methods

Constructors

SqlTableSource(ISqlTableSource, string?)

public SqlTableSource(ISqlTableSource source, string? alias)

Parameters

source ISqlTableSource
alias string

SqlTableSource(ISqlTableSource, string?, params SqlJoinedTable[]?)

public SqlTableSource(ISqlTableSource source, string? alias, params SqlJoinedTable[]? joins)

Parameters

source ISqlTableSource
alias string
joins SqlJoinedTable[]

SqlTableSource(ISqlTableSource, string?, IEnumerable<SqlJoinedTable>, IEnumerable<ISqlExpression[]>?)

public SqlTableSource(ISqlTableSource source, string? alias, IEnumerable<SqlJoinedTable> joins, IEnumerable<ISqlExpression[]>? uniqueKeys)

Parameters

source ISqlTableSource
alias string
joins IEnumerable<SqlJoinedTable>
uniqueKeys IEnumerable<ISqlExpression[]>

Properties

Alias

public string? Alias { get; set; }

Property Value

string

All

public SqlField All { get; }

Property Value

SqlField

CanBeNull

public bool CanBeNull { get; }

Property Value

bool

ElementType

public QueryElementType ElementType { get; }

Property Value

QueryElementType

HasUniqueKeys

public bool HasUniqueKeys { get; }

Property Value

bool

this[ISqlTableSource]

public SqlTableSource? this[ISqlTableSource table] { get; }

Parameters

table ISqlTableSource

Property Value

SqlTableSource

this[ISqlTableSource, string?]

public SqlTableSource? this[ISqlTableSource table, string? alias] { get; }

Parameters

table ISqlTableSource
alias string

Property Value

SqlTableSource

Joins

public List<SqlJoinedTable> Joins { get; }

Property Value

List<SqlJoinedTable>

Precedence

public int Precedence { get; }

Property Value

int

Source

public ISqlTableSource Source { get; set; }

Property Value

ISqlTableSource

SourceID

public int SourceID { get; }

Property Value

int

SqlTableType

public SqlTableType SqlTableType { get; }

Property Value

SqlTableType

SystemType

public Type? SystemType { get; }

Property Value

Type

UniqueKeys

Contains list of columns that build unique key for Source. Used in JoinOptimizer for safely removing sub-query from resulting SQL.

public List<ISqlExpression[]> UniqueKeys { get; }

Property Value

List<ISqlExpression[]>

Methods

Deconstruct(out ISqlTableSource)

public void Deconstruct(out ISqlTableSource source)

Parameters

source ISqlTableSource

Equals(ISqlExpression, Func<ISqlExpression, ISqlExpression, bool>)

public bool Equals(ISqlExpression other, Func<ISqlExpression, ISqlExpression, bool> comparer)

Parameters

other ISqlExpression
comparer Func<ISqlExpression, ISqlExpression, bool>

Returns

bool

ForEach<TContext>(TContext, Action<TContext, SqlTableSource>, HashSet<SelectQuery>)

public void ForEach<TContext>(TContext context, Action<TContext, SqlTableSource> action, HashSet<SelectQuery> visitedQueries)

Parameters

context TContext
action Action<TContext, SqlTableSource>
visitedQueries HashSet<SelectQuery>

Type Parameters

TContext

GetJoinNumber()

public int GetJoinNumber()

Returns

int

GetTables()

public IEnumerable<ISqlTableSource> GetTables()

Returns

IEnumerable<ISqlTableSource>

Walk<TContext>(WalkOptions, TContext, Func<TContext, ISqlExpression, ISqlExpression>)

public ISqlExpression Walk<TContext>(WalkOptions options, TContext context, Func<TContext, ISqlExpression, ISqlExpression> func)

Parameters

options WalkOptions
context TContext
func Func<TContext, ISqlExpression, ISqlExpression>

Returns

ISqlExpression

Type Parameters

TContext