/// <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); }
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); }
public static PartialConditionalClause Where(this SetClause setClause, string column) { var condition = new Condition(setClause); var partial = new PartialConditionalClause(condition); partial.AddColumn(column); return(partial); }
/// <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); }
/// <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); }
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); }