Table of Contents

Class SqlTable

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

Constructors

SqlTable(EntityDescriptor, string?)

public SqlTable(EntityDescriptor entityDescriptor, string? physicalName = null)

Parameters

entityDescriptor EntityDescriptor
physicalName string

SqlTable(SqlTable)

public SqlTable(SqlTable table)

Parameters

table SqlTable

SqlTable(SqlTable, IEnumerable<SqlField>, ISqlExpression[])

public SqlTable(SqlTable table, IEnumerable<SqlField> fields, ISqlExpression[] tableArguments)

Parameters

table SqlTable
fields IEnumerable<SqlField>
tableArguments ISqlExpression[]

SqlTable(Type, int?, SqlObjectName)

protected SqlTable(Type objectType, int? sourceId, SqlObjectName tableName)

Parameters

objectType Type
sourceId int?
tableName SqlObjectName

Properties

Alias

public string? Alias { get; set; }

Property Value

string

All

public SqlField All { get; }

Property Value

SqlField

CanBeNull

public bool CanBeNull { get; set; }

Property Value

bool

ElementType

public virtual QueryElementType ElementType { get; }

Property Value

QueryElementType

Expression

Custom SQL expression format string (used together with TableArguments) to transform SqlTable to custom table expression. Arguments:

public string? Expression { get; set; }

Property Value

string

Fields

public IReadOnlyList<SqlField> Fields { get; }

Property Value

IReadOnlyList<SqlField>

ID

public virtual string? ID { get; set; }

Property Value

string

IdentityFields

public IReadOnlyList<SqlField> IdentityFields { get; }

Property Value

IReadOnlyList<SqlField>

ObjectType

public Type ObjectType { get; protected set; }

Property Value

Type

SequenceAttributes

public SequenceNameAttribute[]? SequenceAttributes { get; protected set; }

Property Value

SequenceNameAttribute[]

SourceID

public int SourceID { get; }

Property Value

int

SqlQueryExtensions

public List<SqlQueryExtension>? SqlQueryExtensions { get; set; }

Property Value

List<SqlQueryExtension>

SqlTableType

public virtual SqlTableType SqlTableType { get; set; }

Property Value

SqlTableType

TableArguments

public ISqlExpression[]? TableArguments { get; set; }

Property Value

ISqlExpression[]

TableName

public virtual SqlObjectName TableName { get; set; }

Property Value

SqlObjectName

TableOptions

public TableOptions TableOptions { get; set; }

Property Value

TableOptions

Methods

Add(SqlField)

public void Add(SqlField field)

Parameters

field SqlField

AddRange(IEnumerable<SqlField>)

public void AddRange(IEnumerable<SqlField> collection)

Parameters

collection IEnumerable<SqlField>

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

FindFieldByMemberName(string)

Search for table field by mapping class member name.

public SqlField? FindFieldByMemberName(string memberName)

Parameters

memberName string

Mapping class member name.

Returns

SqlField

GetIdentityField()

public SqlField? GetIdentityField()

Returns

SqlField

GetKeys(bool)

public IList<ISqlExpression> GetKeys(bool allIfEmpty)

Parameters

allIfEmpty bool

Returns

IList<ISqlExpression>

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

ToString(StringBuilder, Dictionary<IQueryElement, IQueryElement>)

public virtual StringBuilder ToString(StringBuilder sb, Dictionary<IQueryElement, IQueryElement> dic)

Parameters

sb StringBuilder
dic Dictionary<IQueryElement, IQueryElement>

Returns

StringBuilder

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

public virtual 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