Ejemplo n.º 1
0
        /// <summary>
        /// SQL 'VALUES' clause extensions. Add new 'SET' in clause.
        /// </summary>
        /// <param name="command">The command.</param>
        /// <param name="phrases">The 'SET' phrases.</param>
        /// <returns>The command.</returns>
        public static APSqlInsertCommand set(this APSqlInsertCommand command, params APSqlSetPhrase[] phrases)
        {
            if (command.ValuesClause == null || command.ValuesClause.Next == null)
            {
                command.ValuesClause = new APSqlValuesClause(phrases);
            }
            else
            {
                APSqlSetPhrase exist = command.ValuesClause.Last as APSqlSetPhrase;
                exist.SetNext(phrases);
            }

            return(command);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// SQL 'VALUES' clause extensions. Add new 'SET' in clause.
        /// </summary>
        /// <param name="command">The command.</param>
        /// <param name="phrase">The 'SET' phrase.</param>
        /// <returns>The command.</returns>
        public static APSqlUpdateCommand set(this APSqlUpdateCommand command, APSqlSetPhrase phrase)
        {
            if (command.ValuesClause == null || command.ValuesClause.Next == null)
            {
                command.ValuesClause = new APSqlValuesClause(phrase);
            }
            else
            {
                APSqlSetPhrase exist = command.ValuesClause.Last as APSqlSetPhrase;
                exist.SetNext(phrase);
            }

            return(command);
        }