private void AppendWhereClauses() { if (WhereClauses.Any()) { var combinedWhereClauses = string.Join("\n", WhereClauses); resultStringBuilder.Append(string.Format("\nWHERE {0}", combinedWhereClauses)); } }
/// <summary> /// Adds the where. /// </summary> /// <param name="clause">The clause.</param> public void AddWhere(WhereClause clause) { if (!WhereClauses.Any()) { clause.LogicOperator = null; } WhereClauses.Add(clause); }
public override string Build() { var combinedSets = string.Join(", ", sets); if (!WhereClauses.Any()) { return(string.Format("UPDATE '{0}'\nSET {1}", tableName, combinedSets)); } var combinedWhereClauses = string.Join("\n", WhereClauses); return(string.Format("UPDATE '{0}'\nSET {1}\nWHERE {2}", tableName, combinedSets, combinedWhereClauses)); }
public override ISelect GenerateSelectWithoutDefaultOrderBy() { var hasNoConfiguration = customAlias == null && !OrderByClauses.Any() && !WhereClauses.Any() && ColumnSelection == null && RowSelection == null; return(hasNoConfiguration ? innerSelect : base.GenerateSelectWithoutDefaultOrderBy()); }