Example #1
0
        /// <summary>
        /// Sets the column.
        /// </summary>
        /// <typeparam name="T">The type of value for the column.</typeparam>
        /// <param name="connection">The connection query on.</param>
        /// <param name="column">The column.</param>
        /// <param name="value">The value.</param>
        /// <returns>A SetClause</returns>
        public static SetClause Set <T>(this IDbConnection connection, string column, T value)
        {
            var set = new SetClause(connection);

            set.Add(column, value);
            return(set);
        }
Example #2
0
        public static Condition Where <T>(this SetClause setClause, string column, T value)
        {
            var condition = new Condition(setClause);

            condition.Add(column, ComparisonOperator.EqualTo, value);
            return(condition);
        }
Example #3
0
        public static PartialConditionalClause Where(this SetClause setClause, string column)
        {
            var condition = new Condition(setClause);
            var partial   = new PartialConditionalClause(condition);

            partial.AddColumn(column);
            return(partial);
        }
Example #4
0
        /// <summary>
        /// Sets the column.
        /// </summary>
        /// <typeparam name="T">The type of value for the column.</typeparam>
        /// <param name="set"></param>
        /// <param name="expression">The linq expression.</param>
        /// <returns>A SetClause</returns>
        public static SetClause Set <T>(this SetClause set, Expression <Func <T, bool> > expression)
        {
            if (expression is null)
            {
                throw new ArgumentNullException(nameof(expression));
            }

            expression.Body.WalkThrough((name, _, value) => set.Add(name, value));
            return(set);
        }
Example #5
0
        /// <summary>
        /// Sets the column.
        /// </summary>
        /// <typeparam name="T">The type of value for the column.</typeparam>
        /// <param name="set">The SetClause.</param>
        /// <param name="column">The column.</param>
        /// <param name="value">The value.</param>
        /// <returns>A SetClause</returns>
        public static SetClause Set <T>(this SetClause set, string column, T value)
        {
            if (set is null)
            {
                throw new ArgumentNullException(nameof(set));
            }

            set.Add(column, value);
            return(set);
        }
Example #6
0
        public static Condition Where <T>(this SetClause setClause, Expression <Func <T, bool> > expression)
        {
            if (expression is null)
            {
                throw new ArgumentNullException(nameof(expression));
            }

            var condition = new Condition(setClause);

            condition.Add(expression);
            return(condition);
        }