Esempio n. 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);
        }
Esempio n. 2
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);
        }
Esempio n. 3
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);
        }