public static SqlClause Add([NotNull] this SqlClause source, [NotNull] SqlClause sqlClause, bool trimmed = false) { if (sqlClause == null) { throw new ArgumentNullException("sqlClause"); } var sql = sqlClause.GetSql(); if (trimmed) { sql = sql.Trim(' ', '\t', '\n', '\r'); } source.Add(sql); source.Add(sqlClause.GetParameters()); return(source); }
public SqlClause Add([NotNull] string key, [NotNull] SqlClause sqlClause, bool overwrite = false) { if (sqlClause == null) { throw new ArgumentNullException("sqlClause"); } if (this.ContainsExpression(key) && !overwrite) { return(this); } this.Add(key, sqlClause.GetSql(), overwrite); foreach (var parameter in sqlClause.GetParameters()) { this.Add(parameter); } return(this); }
public static SqlClause Add([NotNull] this SqlClause source, [NotNull] params IDbDataParameter[] parameters) { return(source.Add((IEnumerable <IDbDataParameter>)parameters)); }
/// <summary> /// Initializes a new instance of the <see cref="SqlSelectStatementBuilder" /> class. /// </summary> public SqlSelectStatementBuilder([NotNull] string tableName) { this.select = SqlClauseBuilder.Select(); this.from = SqlClauseBuilder.From(tableName); }
public static SqlClause AddLess(this SqlClause sqlClause, [NotNull] string columnName, [CanBeNull] IDbDataParameter parameter) { return(sqlClause.AddPredicate(columnName, " < ", parameter)); }
public static SqlClause AddIsNotNull(this SqlClause sqlClause, [NotNull] string columnName) { sqlClause.Add(columnName + " is not null"); return(sqlClause); }
public static SqlClause AddNotIn(this SqlClause sqlClause, [NotNull] string columnName, [CanBeNull] params IDbDataParameter[] parameters) { return(sqlClause.AddNotIn(columnName, (IEnumerable <IDbDataParameter>)parameters)); }