Table of Contents

Class EntityBuilder

Namespace
NextORM.Core
Assembly
nextorm.core.dll

Fluent query builder over a table addressed by name (TableAlias mode); created by IDataContext.From("table").

public class EntityBuilder : ICloneable
Inheritance
EntityBuilder
Implements
Inherited Members
Extension Methods

Constructors

EntityBuilder(IDataContext)

Initializes a builder in the named-table (TableAlias) mode.

public EntityBuilder(IDataContext dataProvider)

Parameters

dataProvider IDataContext

The data context that creates the query command.

EntityBuilder(IDataContext, string?)

Initializes a builder over the table named table.

public EntityBuilder(IDataContext dataProvider, string? table)

Parameters

dataProvider IDataContext

The data context that creates the query command.

table string

The physical table name to select from, or null when it is supplied later.

Fields

_joins

The join clauses collected so far, or null when the query has no joins.

protected List<JoinExpression>? _joins

Field Value

List<JoinExpression>

Methods

Clone()

Returns a copy of this builder. Because the modifier methods already return copies, this is useful to fork a query without applying a modifier.

public EntityBuilder Clone()

Returns

EntityBuilder

A new builder with the same state.

CloneImp()

Creates the copy returned by Clone() and the explicit ICloneable.Clone call. Overridden by derived builders to clone their extra state.

protected virtual object CloneImp()

Returns

object

A new builder with the same state.

CopyTo(EntityBuilder)

Copies this builder's state onto dst; called by CloneImp(). Protected so derived builders can extend the copy with their own state.

protected virtual void CopyTo(EntityBuilder dst)

Parameters

dst EntityBuilder

The builder that receives the state.

CrossApply(EntityBuilder)

Applies from to every left-hand row (CROSS APPLY / CROSS JOIN LATERAL); there is no ON condition.

public JoinedEntityBuilder<TableAlias, TableAlias> CrossApply(EntityBuilder from)

Parameters

from EntityBuilder

The named-table builder whose source is applied.

Returns

JoinedEntityBuilder<TableAlias, TableAlias>

A builder over the joined projection.

CrossApply(string, Action<JoinOptions>?)

Adds a CROSS APPLY over the table named table on this named-table source.

public JoinedEntityBuilder<TableAlias, TableAlias> CrossApply(string table, Action<JoinOptions>? options = null)

Parameters

table string
options Action<JoinOptions>

Returns

JoinedEntityBuilder<TableAlias, TableAlias>

Remarks

A null, empty, or whitespace-only table is rejected at the call site with ArgumentNullException / ArgumentException (ParamName == "table"), matching the explicit ctx.From(table) form.

CrossApply<TJoinEntity>(Cte<TJoinEntity>)

Applies the typed CTE cte with CROSS APPLY.

public JoinedEntityBuilder<TableAlias, TJoinEntity> CrossApply<TJoinEntity>(Cte<TJoinEntity> cte)

Parameters

cte Cte<TJoinEntity>

The CTE descriptor, converted with this builder's context.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the applied projection.

Type Parameters

TJoinEntity

The CTE's projection type.

Exceptions

ArgumentNullException

cte is null.

CrossApply<TJoinEntity>(Cte<TJoinEntity>, Action<JoinOptions>?)

Applies the typed CTE cte with CROSS APPLY and per-join options.

public JoinedEntityBuilder<TableAlias, TJoinEntity> CrossApply<TJoinEntity>(Cte<TJoinEntity> cte, Action<JoinOptions>? options)

Parameters

cte Cte<TJoinEntity>

The CTE descriptor, converted with this builder's context.

options Action<JoinOptions>

Per-join configuration.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the applied projection.

Type Parameters

TJoinEntity

The CTE's projection type.

Exceptions

ArgumentNullException

cte is null.

CrossApply<TJoinEntity>(EntityBuilder<TJoinEntity>)

Applies _ to every left-hand row (CROSS APPLY / CROSS JOIN LATERAL); there is no ON condition.

public JoinedEntityBuilder<TableAlias, TJoinEntity> CrossApply<TJoinEntity>(EntityBuilder<TJoinEntity> _)

Parameters

_ EntityBuilder<TJoinEntity>

The builder for the joined entity; only its source is used.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

CrossApply<TJoinEntity>(Action<JoinOptions>?)

Adds a CROSS APPLY over TJoinEntity without an explicit source; TJoinEntity is resolved through this builder's context (From<TJoinEntity>()) and forwarded to the source-explicit overload.

public JoinedEntityBuilder<TableAlias, TJoinEntity> CrossApply<TJoinEntity>(Action<JoinOptions>? options = null)

Parameters

options Action<JoinOptions>

Optional per-join configuration; forwarded unchanged to the source-explicit overload.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the projection extended with TJoinEntity.

Type Parameters

TJoinEntity

The entity type of the joined table.

CrossJoin(EntityBuilder)

Adds a cross join producing the Cartesian product of the two sources; there is no ON condition.

public JoinedEntityBuilder<TableAlias, TableAlias> CrossJoin(EntityBuilder from)

Parameters

from EntityBuilder

The named-table builder whose source is joined.

Returns

JoinedEntityBuilder<TableAlias, TableAlias>

A builder over the joined projection.

CrossJoin(string, Action<JoinOptions>?)

Adds a CROSS JOIN over the table named table on this named-table source.

public JoinedEntityBuilder<TableAlias, TableAlias> CrossJoin(string table, Action<JoinOptions>? options = null)

Parameters

table string
options Action<JoinOptions>

Returns

JoinedEntityBuilder<TableAlias, TableAlias>

Remarks

A null, empty, or whitespace-only table is rejected at the call site with ArgumentNullException / ArgumentException (ParamName == "table"), matching the explicit ctx.From(table) form.

CrossJoin<TJoinEntity>(Cte<TJoinEntity>)

Adds a cross join over the typed CTE cte.

public JoinedEntityBuilder<TableAlias, TJoinEntity> CrossJoin<TJoinEntity>(Cte<TJoinEntity> cte)

Parameters

cte Cte<TJoinEntity>

The CTE descriptor, converted with this builder's context.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

The CTE's projection type.

Exceptions

ArgumentNullException

cte is null.

CrossJoin<TJoinEntity>(Cte<TJoinEntity>, Action<JoinOptions>?)

Adds a cross join over the typed CTE cte with per-join options.

public JoinedEntityBuilder<TableAlias, TJoinEntity> CrossJoin<TJoinEntity>(Cte<TJoinEntity> cte, Action<JoinOptions>? options)

Parameters

cte Cte<TJoinEntity>

The CTE descriptor, converted with this builder's context.

options Action<JoinOptions>

Per-join configuration.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

The CTE's projection type.

Exceptions

ArgumentNullException

cte is null.

CrossJoin<TJoinEntity>(EntityBuilder<TJoinEntity>)

Adds a cross join producing the Cartesian product of the two sources; there is no ON condition.

public JoinedEntityBuilder<TableAlias, TJoinEntity> CrossJoin<TJoinEntity>(EntityBuilder<TJoinEntity> _)

Parameters

_ EntityBuilder<TJoinEntity>

The builder for the joined entity; only its source is used.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

CrossJoin<TJoinEntity>(Action<JoinOptions>?)

Adds a CROSS JOIN over TJoinEntity without an explicit source; TJoinEntity is resolved through this builder's context (From<TJoinEntity>()) and forwarded to the source-explicit overload.

public JoinedEntityBuilder<TableAlias, TJoinEntity> CrossJoin<TJoinEntity>(Action<JoinOptions>? options = null)

Parameters

options Action<JoinOptions>

Optional per-join configuration; forwarded unchanged to the source-explicit overload.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the projection extended with TJoinEntity.

Type Parameters

TJoinEntity

The entity type of the joined table.

FullJoin(EntityBuilder, Expression<Func<TableAlias, TableAlias, bool>>, Action<JoinOptions>?)

Adds a full outer join to from: unmatched rows from both sides are kept, with the other side's columns set to NULL.

public JoinedEntityBuilder<TableAlias, TableAlias> FullJoin(EntityBuilder from, Expression<Func<TableAlias, TableAlias, bool>> joinCondition, Action<JoinOptions>? options = null)

Parameters

from EntityBuilder

The named-table builder whose source is joined.

joinCondition Expression<Func<TableAlias, TableAlias, bool>>

The join predicate over the two table aliases.

options Action<JoinOptions>

Optional per-join configuration, for example j => j.Global() or j => j.WithStrictness(JoinStrictness.Any).

Returns

JoinedEntityBuilder<TableAlias, TableAlias>

A builder over the joined projection.

FullJoin(string, Expression<Func<TableAlias, TableAlias, bool>>, Action<JoinOptions>?)

Adds a FULL JOIN over the table named table on this named-table source.

public JoinedEntityBuilder<TableAlias, TableAlias> FullJoin(string table, Expression<Func<TableAlias, TableAlias, bool>> joinCondition, Action<JoinOptions>? options = null)

Parameters

table string
joinCondition Expression<Func<TableAlias, TableAlias, bool>>
options Action<JoinOptions>

Returns

JoinedEntityBuilder<TableAlias, TableAlias>

Remarks

A null joinCondition is accepted and renders no ON clause, matching the explicit form over ctx.From(table).

FullJoin<TJoinEntity>(Cte<TJoinEntity>, Expression<Func<TableAlias, TJoinEntity, bool>>)

Adds a full outer join over the typed CTE cte.

public JoinedEntityBuilder<TableAlias, TJoinEntity> FullJoin<TJoinEntity>(Cte<TJoinEntity> cte, Expression<Func<TableAlias, TJoinEntity, bool>> joinCondition)

Parameters

cte Cte<TJoinEntity>

The CTE descriptor, converted with this builder's context.

joinCondition Expression<Func<TableAlias, TJoinEntity, bool>>

The join predicate over the table alias and the joined entity.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

The CTE's projection type.

Exceptions

ArgumentNullException

cte or joinCondition is null.

FullJoin<TJoinEntity>(Cte<TJoinEntity>, Expression<Func<TableAlias, TJoinEntity, bool>>, Action<JoinOptions>?)

Adds a full outer join over the typed CTE cte with per-join options.

public JoinedEntityBuilder<TableAlias, TJoinEntity> FullJoin<TJoinEntity>(Cte<TJoinEntity> cte, Expression<Func<TableAlias, TJoinEntity, bool>> joinCondition, Action<JoinOptions>? options)

Parameters

cte Cte<TJoinEntity>

The CTE descriptor, converted with this builder's context.

joinCondition Expression<Func<TableAlias, TJoinEntity, bool>>

The join predicate over the table alias and the joined entity.

options Action<JoinOptions>

Per-join configuration.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

The CTE's projection type.

Exceptions

ArgumentNullException

cte or joinCondition is null.

FullJoin<TJoinEntity>(EntityBuilder<TJoinEntity>, Expression<Func<TableAlias, TJoinEntity, bool>>, Action<JoinOptions>?)

Adds a full outer join to _: unmatched rows from both sides are kept, with the other side's columns set to NULL.

public JoinedEntityBuilder<TableAlias, TJoinEntity> FullJoin<TJoinEntity>(EntityBuilder<TJoinEntity> _, Expression<Func<TableAlias, TJoinEntity, bool>> joinCondition, Action<JoinOptions>? options = null)

Parameters

_ EntityBuilder<TJoinEntity>

The builder for the joined entity; only its source is used.

joinCondition Expression<Func<TableAlias, TJoinEntity, bool>>

The join predicate over the table alias and the joined entity.

options Action<JoinOptions>

Optional per-join configuration, for example j => j.Global() or j => j.WithStrictness(JoinStrictness.Any).

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

Join(EntityBuilder, Expression<Func<TableAlias, TableAlias, bool>>, Action<JoinOptions>?)

Adds an inner join to from, using joinCondition as the ON predicate; only matching pairs survive.

public JoinedEntityBuilder<TableAlias, TableAlias> Join(EntityBuilder from, Expression<Func<TableAlias, TableAlias, bool>> joinCondition, Action<JoinOptions>? options = null)

Parameters

from EntityBuilder

The named-table builder whose source is joined.

joinCondition Expression<Func<TableAlias, TableAlias, bool>>

The join predicate over the two table aliases.

options Action<JoinOptions>

Optional per-join configuration, for example j => j.Global() or j => j.WithStrictness(JoinStrictness.Any).

Returns

JoinedEntityBuilder<TableAlias, TableAlias>

A builder over the joined projection.

Join(string, Expression<Func<TableAlias, TableAlias, bool>>, Action<JoinOptions>?)

Adds an INNER JOIN over the table named table on this named-table source.

public JoinedEntityBuilder<TableAlias, TableAlias> Join(string table, Expression<Func<TableAlias, TableAlias, bool>> joinCondition, Action<JoinOptions>? options = null)

Parameters

table string
joinCondition Expression<Func<TableAlias, TableAlias, bool>>
options Action<JoinOptions>

Returns

JoinedEntityBuilder<TableAlias, TableAlias>

Remarks

A null joinCondition is accepted and renders no ON clause, matching the explicit form over ctx.From(table).

Join<TJoinEntity>(Cte<TJoinEntity>, Expression<Func<TableAlias, TJoinEntity, bool>>)

Adds an inner join over the typed CTE cte.

public JoinedEntityBuilder<TableAlias, TJoinEntity> Join<TJoinEntity>(Cte<TJoinEntity> cte, Expression<Func<TableAlias, TJoinEntity, bool>> joinCondition)

Parameters

cte Cte<TJoinEntity>

The CTE descriptor, converted with this builder's context.

joinCondition Expression<Func<TableAlias, TJoinEntity, bool>>

The join predicate over the table alias and the joined entity.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

The CTE's projection type.

Exceptions

ArgumentNullException

cte or joinCondition is null.

Join<TJoinEntity>(Cte<TJoinEntity>, Expression<Func<TableAlias, TJoinEntity, bool>>, Action<JoinOptions>?)

Adds an inner join over the typed CTE cte with per-join options.

public JoinedEntityBuilder<TableAlias, TJoinEntity> Join<TJoinEntity>(Cte<TJoinEntity> cte, Expression<Func<TableAlias, TJoinEntity, bool>> joinCondition, Action<JoinOptions>? options)

Parameters

cte Cte<TJoinEntity>

The CTE descriptor, converted with this builder's context.

joinCondition Expression<Func<TableAlias, TJoinEntity, bool>>

The join predicate over the table alias and the joined entity.

options Action<JoinOptions>

Per-join configuration.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

The CTE's projection type.

Exceptions

ArgumentNullException

cte or joinCondition is null.

Join<TJoinEntity>(EntityBuilder<TJoinEntity>, Expression<Func<TableAlias, TJoinEntity, bool>>, Action<JoinOptions>?)

Adds an inner join to _, using joinCondition as the ON predicate; only matching pairs survive.

public JoinedEntityBuilder<TableAlias, TJoinEntity> Join<TJoinEntity>(EntityBuilder<TJoinEntity> _, Expression<Func<TableAlias, TJoinEntity, bool>> joinCondition, Action<JoinOptions>? options = null)

Parameters

_ EntityBuilder<TJoinEntity>

The builder for the joined entity; only its source is used.

joinCondition Expression<Func<TableAlias, TJoinEntity, bool>>

The join predicate over the table alias and the joined entity.

options Action<JoinOptions>

Optional per-join configuration, for example j => j.Global() or j => j.WithStrictness(JoinStrictness.Any).

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

LeftJoin(EntityBuilder, Expression<Func<TableAlias, TableAlias, bool>>, Action<JoinOptions>?)

Adds a left outer join to from: every left-hand row is kept, and right-hand columns are NULL when there is no match.

public JoinedEntityBuilder<TableAlias, TableAlias> LeftJoin(EntityBuilder from, Expression<Func<TableAlias, TableAlias, bool>> joinCondition, Action<JoinOptions>? options = null)

Parameters

from EntityBuilder

The named-table builder whose source is joined.

joinCondition Expression<Func<TableAlias, TableAlias, bool>>

The join predicate over the two table aliases.

options Action<JoinOptions>

Optional per-join configuration, for example j => j.Global() or j => j.WithStrictness(JoinStrictness.Any).

Returns

JoinedEntityBuilder<TableAlias, TableAlias>

A builder over the joined projection.

LeftJoin(string, Expression<Func<TableAlias, TableAlias, bool>>, Action<JoinOptions>?)

Adds a LEFT JOIN over the table named table on this named-table source.

public JoinedEntityBuilder<TableAlias, TableAlias> LeftJoin(string table, Expression<Func<TableAlias, TableAlias, bool>> joinCondition, Action<JoinOptions>? options = null)

Parameters

table string
joinCondition Expression<Func<TableAlias, TableAlias, bool>>
options Action<JoinOptions>

Returns

JoinedEntityBuilder<TableAlias, TableAlias>

Remarks

A null joinCondition is accepted and renders no ON clause, matching the explicit form over ctx.From(table).

LeftJoin<TJoinEntity>(Cte<TJoinEntity>, Expression<Func<TableAlias, TJoinEntity, bool>>)

Adds a left outer join over the typed CTE cte.

public JoinedEntityBuilder<TableAlias, TJoinEntity> LeftJoin<TJoinEntity>(Cte<TJoinEntity> cte, Expression<Func<TableAlias, TJoinEntity, bool>> joinCondition)

Parameters

cte Cte<TJoinEntity>

The CTE descriptor, converted with this builder's context.

joinCondition Expression<Func<TableAlias, TJoinEntity, bool>>

The join predicate over the table alias and the joined entity.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

The CTE's projection type.

Exceptions

ArgumentNullException

cte or joinCondition is null.

LeftJoin<TJoinEntity>(Cte<TJoinEntity>, Expression<Func<TableAlias, TJoinEntity, bool>>, Action<JoinOptions>?)

Adds a left outer join over the typed CTE cte with per-join options.

public JoinedEntityBuilder<TableAlias, TJoinEntity> LeftJoin<TJoinEntity>(Cte<TJoinEntity> cte, Expression<Func<TableAlias, TJoinEntity, bool>> joinCondition, Action<JoinOptions>? options)

Parameters

cte Cte<TJoinEntity>

The CTE descriptor, converted with this builder's context.

joinCondition Expression<Func<TableAlias, TJoinEntity, bool>>

The join predicate over the table alias and the joined entity.

options Action<JoinOptions>

Per-join configuration.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

The CTE's projection type.

Exceptions

ArgumentNullException

cte or joinCondition is null.

LeftJoin<TJoinEntity>(EntityBuilder<TJoinEntity>, Expression<Func<TableAlias, TJoinEntity, bool>>, Action<JoinOptions>?)

Adds a left outer join to _: every left-hand row is kept, and right-hand columns are NULL when there is no match.

public JoinedEntityBuilder<TableAlias, TJoinEntity> LeftJoin<TJoinEntity>(EntityBuilder<TJoinEntity> _, Expression<Func<TableAlias, TJoinEntity, bool>> joinCondition, Action<JoinOptions>? options = null)

Parameters

_ EntityBuilder<TJoinEntity>

The builder for the joined entity; only its source is used.

joinCondition Expression<Func<TableAlias, TJoinEntity, bool>>

The join predicate over the table alias and the joined entity.

options Action<JoinOptions>

Optional per-join configuration, for example j => j.Global() or j => j.WithStrictness(JoinStrictness.Any).

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

OuterApply(EntityBuilder)

Applies from to every left-hand row, preserving left-hand rows with an empty result (OUTER APPLY / LEFT JOIN LATERAL ... ON true). There is no ON condition.

public JoinedEntityBuilder<TableAlias, TableAlias> OuterApply(EntityBuilder from)

Parameters

from EntityBuilder

The named-table builder whose source is applied.

Returns

JoinedEntityBuilder<TableAlias, TableAlias>

A builder over the joined projection.

OuterApply(string, Action<JoinOptions>?)

Adds an OUTER APPLY over the table named table on this named-table source.

public JoinedEntityBuilder<TableAlias, TableAlias> OuterApply(string table, Action<JoinOptions>? options = null)

Parameters

table string
options Action<JoinOptions>

Returns

JoinedEntityBuilder<TableAlias, TableAlias>

Remarks

A null, empty, or whitespace-only table is rejected at the call site with ArgumentNullException / ArgumentException (ParamName == "table"), matching the explicit ctx.From(table) form.

OuterApply<TJoinEntity>(Cte<TJoinEntity>)

Applies the typed CTE cte with OUTER APPLY.

public JoinedEntityBuilder<TableAlias, TJoinEntity> OuterApply<TJoinEntity>(Cte<TJoinEntity> cte)

Parameters

cte Cte<TJoinEntity>

The CTE descriptor, converted with this builder's context.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the applied projection.

Type Parameters

TJoinEntity

The CTE's projection type.

Exceptions

ArgumentNullException

cte is null.

OuterApply<TJoinEntity>(Cte<TJoinEntity>, Action<JoinOptions>?)

Applies the typed CTE cte with OUTER APPLY and per-join options.

public JoinedEntityBuilder<TableAlias, TJoinEntity> OuterApply<TJoinEntity>(Cte<TJoinEntity> cte, Action<JoinOptions>? options)

Parameters

cte Cte<TJoinEntity>

The CTE descriptor, converted with this builder's context.

options Action<JoinOptions>

Per-join configuration.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the applied projection.

Type Parameters

TJoinEntity

The CTE's projection type.

Exceptions

ArgumentNullException

cte is null.

OuterApply<TJoinEntity>(EntityBuilder<TJoinEntity>)

Applies _ to every left-hand row, preserving left-hand rows with an empty result (OUTER APPLY / LEFT JOIN LATERAL ... ON true). There is no ON condition.

public JoinedEntityBuilder<TableAlias, TJoinEntity> OuterApply<TJoinEntity>(EntityBuilder<TJoinEntity> _)

Parameters

_ EntityBuilder<TJoinEntity>

The builder for the joined entity; only its source is used.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

OuterApply<TJoinEntity>(Action<JoinOptions>?)

Adds an OUTER APPLY over TJoinEntity without an explicit source; TJoinEntity is resolved through this builder's context (From<TJoinEntity>()) and forwarded to the source-explicit overload.

public JoinedEntityBuilder<TableAlias, TJoinEntity> OuterApply<TJoinEntity>(Action<JoinOptions>? options = null)

Parameters

options Action<JoinOptions>

Optional per-join configuration; forwarded unchanged to the source-explicit overload.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the projection extended with TJoinEntity.

Type Parameters

TJoinEntity

The entity type of the joined table.

RightJoin(EntityBuilder, Expression<Func<TableAlias, TableAlias, bool>>, Action<JoinOptions>?)

Adds a right outer join to from: every right-hand row is kept, and left-hand columns are NULL when there is no match.

public JoinedEntityBuilder<TableAlias, TableAlias> RightJoin(EntityBuilder from, Expression<Func<TableAlias, TableAlias, bool>> joinCondition, Action<JoinOptions>? options = null)

Parameters

from EntityBuilder

The named-table builder whose source is joined.

joinCondition Expression<Func<TableAlias, TableAlias, bool>>

The join predicate over the two table aliases.

options Action<JoinOptions>

Optional per-join configuration, for example j => j.Global() or j => j.WithStrictness(JoinStrictness.Any).

Returns

JoinedEntityBuilder<TableAlias, TableAlias>

A builder over the joined projection.

RightJoin(string, Expression<Func<TableAlias, TableAlias, bool>>, Action<JoinOptions>?)

Adds a RIGHT JOIN over the table named table on this named-table source.

public JoinedEntityBuilder<TableAlias, TableAlias> RightJoin(string table, Expression<Func<TableAlias, TableAlias, bool>> joinCondition, Action<JoinOptions>? options = null)

Parameters

table string
joinCondition Expression<Func<TableAlias, TableAlias, bool>>
options Action<JoinOptions>

Returns

JoinedEntityBuilder<TableAlias, TableAlias>

Remarks

A null joinCondition is accepted and renders no ON clause, matching the explicit form over ctx.From(table).

RightJoin<TJoinEntity>(Cte<TJoinEntity>, Expression<Func<TableAlias, TJoinEntity, bool>>)

Adds a right outer join over the typed CTE cte.

public JoinedEntityBuilder<TableAlias, TJoinEntity> RightJoin<TJoinEntity>(Cte<TJoinEntity> cte, Expression<Func<TableAlias, TJoinEntity, bool>> joinCondition)

Parameters

cte Cte<TJoinEntity>

The CTE descriptor, converted with this builder's context.

joinCondition Expression<Func<TableAlias, TJoinEntity, bool>>

The join predicate over the table alias and the joined entity.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

The CTE's projection type.

Exceptions

ArgumentNullException

cte or joinCondition is null.

RightJoin<TJoinEntity>(Cte<TJoinEntity>, Expression<Func<TableAlias, TJoinEntity, bool>>, Action<JoinOptions>?)

Adds a right outer join over the typed CTE cte with per-join options.

public JoinedEntityBuilder<TableAlias, TJoinEntity> RightJoin<TJoinEntity>(Cte<TJoinEntity> cte, Expression<Func<TableAlias, TJoinEntity, bool>> joinCondition, Action<JoinOptions>? options)

Parameters

cte Cte<TJoinEntity>

The CTE descriptor, converted with this builder's context.

joinCondition Expression<Func<TableAlias, TJoinEntity, bool>>

The join predicate over the table alias and the joined entity.

options Action<JoinOptions>

Per-join configuration.

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

The CTE's projection type.

Exceptions

ArgumentNullException

cte or joinCondition is null.

RightJoin<TJoinEntity>(EntityBuilder<TJoinEntity>, Expression<Func<TableAlias, TJoinEntity, bool>>, Action<JoinOptions>?)

Adds a right outer join to _: every right-hand row is kept, and left-hand columns are NULL when there is no match.

public JoinedEntityBuilder<TableAlias, TJoinEntity> RightJoin<TJoinEntity>(EntityBuilder<TJoinEntity> _, Expression<Func<TableAlias, TJoinEntity, bool>> joinCondition, Action<JoinOptions>? options = null)

Parameters

_ EntityBuilder<TJoinEntity>

The builder for the joined entity; only its source is used.

joinCondition Expression<Func<TableAlias, TJoinEntity, bool>>

The join predicate over the table alias and the joined entity.

options Action<JoinOptions>

Optional per-join configuration, for example j => j.Global() or j => j.WithStrictness(JoinStrictness.Any).

Returns

JoinedEntityBuilder<TableAlias, TJoinEntity>

A builder over the joined projection.

Type Parameters

TJoinEntity

Select<TResult>(Expression<Func<TableAlias, TResult>>)

Projects each row with exp and creates the SELECT command for the named table, carrying the set filters, joins and ordering.

public QueryCommand<TResult> Select<TResult>(Expression<Func<TableAlias, TResult>> exp)

Parameters

exp Expression<Func<TableAlias, TResult>>

The projection expression over TableAlias.

Returns

QueryCommand<TResult>

The command that produces TResult rows.

Type Parameters

TResult

The projection type produced by exp.

Where(Expression<Func<TableAlias, bool>>)

Adds condition to the WHERE clause over the named table. A repeated call combines the predicates with and. Returns a new builder; the current one is unchanged.

public EntityBuilder Where(Expression<Func<TableAlias, bool>> condition)

Parameters

condition Expression<Func<TableAlias, bool>>

The predicate each row must satisfy.

Returns

EntityBuilder

A builder with the added predicate.

WithCommandTimeout(int)

Overrides the command timeout in seconds for the commands this builder creates (see WithCommandTimeout(int)): it takes precedence over the context default set with DataContextBuilder.UseCommandTimeout, and a value of zero or less means the provider default. The override is part of the plan-cache key.

public EntityBuilder WithCommandTimeout(int seconds)

Parameters

seconds int

The command timeout in seconds; zero or less uses the provider default.

Returns

EntityBuilder

A builder with the override applied.

WithKeywordCase(KeywordCase)

Overrides the SQL keyword case for the commands this builder creates (see WithKeywordCase(KeywordCase)).

public EntityBuilder WithKeywordCase(KeywordCase keywordCase = KeywordCase.Upper)

Parameters

keywordCase KeywordCase

The keyword case to apply.

Returns

EntityBuilder

A builder with the override applied.

WithNamingConvention(INamingConvention?)

Overrides the naming convention for the commands this builder creates (see WithNamingConvention(INamingConvention?)).

public EntityBuilder WithNamingConvention(INamingConvention? convention)

Parameters

convention INamingConvention

Returns

EntityBuilder

WithQuotedIdentifiers(bool)

Overrides identifier quoting for the commands this builder creates (see WithQuotedIdentifiers(bool)).

public EntityBuilder WithQuotedIdentifiers(bool value = true)

Parameters

value bool

Returns

EntityBuilder

WithTag(string?)

Attaches a query tag to the commands this builder creates (see WithTag(string?)).

public EntityBuilder WithTag(string? tag)

Parameters

tag string

The tag text to render, or null to clear the tag.

Returns

EntityBuilder

A builder with the tag applied.

WithUppercaseKeywords(bool)

Convenience form of WithKeywordCase(KeywordCase): enables (value is true) or disables upper-case SQL keywords for the commands this builder creates.

public EntityBuilder WithUppercaseKeywords(bool value = true)

Parameters

value bool

true to emit keywords in upper case; otherwise lower case.

Returns

EntityBuilder

A builder with the override applied.