// generate SQL code for order by DataTableSql AddOrderBy(ExpressionEval[] expr) { if (SqlOrderByText != null) { return(DataTableSql.CreateFromSubquery(this).AddOrderBy(expr)); } SqlOrderByText = _gen.OrderBy(expr); return(this); }
//--- functions to manipulate queries // generate SQL code for restrict DataTableSql AddWhere(ExpressionEval expr, bool hasgroupby) { if (SqlWhereText != null) { return(DataTableSql.CreateFromSubquery(this).AddWhere(expr, hasgroupby)); } SqlWhereText = (hasgroupby) ? _gen.Having(expr) : _gen.Where(expr); return(this); }