Class LogicalBuilder<TBuilder>
- Namespace
- FluentCommand.Query
- Assembly
- FluentCommand.dll
Provides a generic base class for building logical SQL query expressions (such as grouped AND/OR conditions) with fluent, chainable methods.
public abstract class LogicalBuilder<TBuilder> : WhereBuilder<TBuilder>, IStatementBuilder, IQueryBuilder where TBuilder : LogicalBuilder<TBuilder>
Type Parameters
TBuilder
The type of the builder for fluent chaining.
- Inheritance
-
StatementBuilder<TBuilder>WhereBuilder<TBuilder>LogicalBuilder<TBuilder>
- Implements
- Derived
- Inherited Members
Constructors
LogicalBuilder(IQueryGenerator, List<QueryParameter>, LogicalOperators)
Initializes a new instance of the LogicalBuilder<TBuilder> class.
protected LogicalBuilder(IQueryGenerator queryGenerator, List<QueryParameter> parameters, LogicalOperators logicalOperator = LogicalOperators.And)
Parameters
queryGenerator
IQueryGeneratorThe IQueryGenerator used to generate SQL expressions.
parameters
List<QueryParameter>The list of QueryParameter objects for the query.
logicalOperator
LogicalOperatorsThe logical operator (LogicalOperators) to combine WHERE expressions. Defaults to And.
Methods
BuildStatement()
Builds the logical SQL expression using the current WHERE expressions and logical operator.
public override QueryStatement BuildStatement()
Returns
- QueryStatement
A QueryStatement containing the logical SQL expression and its parameters, or
null
if no WHERE expressions are present.