AbstractDataProcessor<T>


Class: Where
This is an abstract base class for creating where clauses.
You'll have to pass an instantiated instance of one of the below DB-specific classes to any method referencing the Where class.
DB-specific classes: SqlWhere, OracleWhere, MySqlWhere


Methods

AddClause
Main method for building where clauses

AddOperator
Method adds the AND/OR operator to your where clause.

Clear
Method to clear the where clause results.

ToString
Returns the where clause string.

Properties

public Where AddLeftParenthesis {get;}
Add left parenthesis to your where clause

public Where AddLeftParenthesis {get;}
Add right parenthesis to your where clause.

Code example

SqlWhere whereClause = new SqlWhere();
whereClause.AddLeftParenthesis;
whereClause.AddClause("CustomerID", Operator.Num.greaterThan, 5);
whereClause.AddOperator(Operator.AndOr.And);
whereClause.AddClause("CustomerID", Operator.Num.lessThan, 10);
whereClause.AddRightParenthesis;
whereClause.AddOperator(Operator.AndOr.Or);
whereClause.AddClause("CustomerID", Operator.Num.equal, 25);
string sqlClause = whereClause.ToString(); //returns (CustomerID > 5 AND CustomerID < 10) OR CustomerID = 25