/// <summary> /// Adds a single field-value pair to the given UPDATE statement. /// </summary> /// <typeparam name="TUpdate">The type of UPDATE statement.</typeparam> /// <param name="updateQuery">The UPDATE statement to operate on.</param> /// <param name="field">Field to update.</param> /// <param name="value">Expression that provides the field's new value.</param> /// <returns>The given UPDATE statement to enable fluent syntax.</returns> public static TUpdate Update <TUpdate>(this TUpdate updateQuery, Sql.Field field, Sql.IExpression value) where TUpdate : Sql.IUpdate => Update(updateQuery, new Sql.SetField(field, value));
/// <summary> /// Adds a single field-value pair to the given UPDATE statement and sets the value with a /// new <see cref="Sql.Parameter"/> expression. /// </summary> /// <typeparam name="TUpdate">The type of UPDATE statement.</typeparam> /// <param name="updateQuery">The UPDATE statement to operate on.</param> /// <param name="field">Field to update.</param> /// <param name="parameterName">The parameter named used to construct the /// <see cref="Sql.Parameter"/> expression.</param> /// <returns>The given UPDATE statement to enable fluent syntax.</returns> public static TUpdate Update <TUpdate>(this TUpdate updateQuery, Sql.Field field, string parameterName) where TUpdate : Sql.IUpdate => Update(updateQuery, field, new Sql.Parameter(parameterName));
/// <summary> /// Creates a new field object that is associated to the given table object. /// </summary> /// <param name="table">The table used as owner table for the new field object.</param> /// <param name="name">The field's name.</param> /// <param name="alias">The field's alias.</param> /// <returns>The newly created field object.</returns> public static Sql.Field Field(this Sql.ITable table, string name, string alias = null, Action <Sql.Field> fieldCfgFn = null) { Sql.Field field = new Sql.Field(name, table, alias); fieldCfgFn?.Invoke(field); return(field); }