Exemplo n.º 1
0
 private void AppendWhereClauses()
 {
     if (WhereClauses.Any())
     {
         var combinedWhereClauses = string.Join("\n", WhereClauses);
         resultStringBuilder.Append(string.Format("\nWHERE {0}", combinedWhereClauses));
     }
 }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        public override ISelect GenerateSelectWithoutDefaultOrderBy()
        {
            var hasNoConfiguration = customAlias == null && !OrderByClauses.Any() && !WhereClauses.Any() &&
                                     ColumnSelection == null && RowSelection == null;

            return(hasNoConfiguration ? innerSelect : base.GenerateSelectWithoutDefaultOrderBy());
        }