Table of Contents

Class JoinBuilder<TBuilder>

Namespace
FluentCommand.Query
Assembly
FluentCommand.dll

Provides a generic base class for building SQL JOIN clauses with fluent, chainable methods.

public class JoinBuilder<TBuilder> : StatementBuilder<TBuilder>, IStatementBuilder, IQueryBuilder where TBuilder : JoinBuilder<TBuilder>

Type Parameters

TBuilder

The type of the builder for fluent chaining.

Inheritance
JoinBuilder<TBuilder>
Implements
Derived
Inherited Members

Constructors

JoinBuilder(IQueryGenerator, List<QueryParameter>)

Initializes a new instance of the JoinBuilder<TBuilder> class.

public JoinBuilder(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.

Properties

JoinExpression

Gets or sets the join expression that defines the JOIN clause.

protected JoinExpression JoinExpression { get; set; }

Property Value

JoinExpression

The JoinExpression representing the JOIN clause.

Methods

BuildExpression()

Builds and returns the JoinExpression representing the configured JOIN clause.

public virtual JoinExpression BuildExpression()

Returns

JoinExpression

The JoinExpression for the JOIN clause.

BuildStatement()

Builds the SQL JOIN statement using the current configuration.

public override QueryStatement BuildStatement()

Returns

QueryStatement

A QueryStatement containing the SQL JOIN clause and its parameters.

Left(string, string)

Specifies the left column to join on.

public TBuilder Left(string columnName, string tableAlias)

Parameters

columnName string

The name of the column in the left table.

tableAlias string

The alias of the left table.

Returns

TBuilder

The same builder instance for method chaining.

Right(string, string, string, string)

Specifies the right column and table to join on.

public TBuilder Right(string columnName, string tableName, string tableSchema, string tableAlias)

Parameters

columnName string

The name of the column in the right table.

tableName string

The name of the right table.

tableSchema string

The schema of the right table.

tableAlias string

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

Returns

TBuilder

The same builder instance for method chaining.

Type(JoinTypes)

Specifies the type of SQL JOIN operation to use.

public TBuilder Type(JoinTypes joinType)

Parameters

joinType JoinTypes

The JoinTypes value indicating the type of join (e.g., Inner, Left, Right).

Returns

TBuilder

The same builder instance for method chaining.