Table of Contents

Class JoinEntityBuilder<TLeft, TRight>

Namespace
FluentCommand.Query
Assembly
FluentCommand.dll

Provides a builder for constructing SQL JOIN clauses between two entity types with fluent, chainable methods.

public class JoinEntityBuilder<TLeft, TRight> : JoinBuilder<JoinEntityBuilder<TLeft, TRight>>, IStatementBuilder, IQueryBuilder where TLeft : class where TRight : class

Type Parameters

TLeft

The entity type of the left join.

TRight

The entity type of the right join.

Inheritance
JoinEntityBuilder<TLeft, TRight>
Implements
Inherited Members

Constructors

JoinEntityBuilder(IQueryGenerator, List<QueryParameter>)

Initializes a new instance of the JoinEntityBuilder<TLeft, TRight> class.

public JoinEntityBuilder(IQueryGenerator queryGenerator, List<QueryParameter> parameters)

Parameters

queryGenerator IQueryGenerator

The IQueryGenerator used to generate SQL expressions.

parameters List<QueryParameter>

The list of QueryParameter objects for the query.

Methods

Left<TValue>(Expression<Func<TLeft, TValue>>, string)

Specifies the left property to join on using a strongly-typed property expression.

public JoinEntityBuilder<TLeft, TRight> Left<TValue>(Expression<Func<TLeft, TValue>> property, string tableAlias)

Parameters

property Expression<Func<TLeft, TValue>>

An expression selecting the property on the left entity to join on.

tableAlias string

The alias of the left table.

Returns

JoinEntityBuilder<TLeft, TRight>

The same builder instance for method chaining.

Type Parameters

TValue

The type of the property value.

Right<TValue>(Expression<Func<TRight, TValue>>, string)

Specifies the right property to join on using a strongly-typed property expression. The table name and schema are inferred from the right entity type.

public JoinEntityBuilder<TLeft, TRight> Right<TValue>(Expression<Func<TRight, TValue>> property, string tableAlias)

Parameters

property Expression<Func<TRight, TValue>>

An expression selecting the property on the right entity to join on.

tableAlias string

The alias of the right table.

Returns

JoinEntityBuilder<TLeft, TRight>

The same builder instance for method chaining.

Type Parameters

TValue

The type of the property value.

Right<TValue>(Expression<Func<TRight, TValue>>, string, string, string)

Specifies the right property to join on using a strongly-typed property expression and explicit table information.

public JoinEntityBuilder<TLeft, TRight> Right<TValue>(Expression<Func<TRight, TValue>> property, string tableName, string tableSchema, string tableAlias)

Parameters

property Expression<Func<TRight, TValue>>

An expression selecting the property on the right entity to join on.

tableName string

The name of the right table. If null, the entity mapping is used.

tableSchema string

The schema of the right table. If null, the entity mapping is used.

tableAlias string

The alias of the right table. If null, the table name is used as the alias.

Returns

JoinEntityBuilder<TLeft, TRight>

The same builder instance for method chaining.

Type Parameters

TValue

The type of the property value.