Skip to content

UpdateSetBuilder1 Class` ​

Definition ​

Immutable, fluent builder for constructing and executing an UPDATE statement for T using predicate state derived from a QueryBuilder`1.

  • Namespace: JASE.Database
  • Assembly: JASE.Database.dll

Properties ​

NameDescription
AssignmentsGets the current column assignments that will be emitted in the SET clause.

Methods ​

NameDescription
UpdateSetBuilder<T> AllowUnfilteredMutation()Opts into an intentional match-all UPDATE (WHERE 1=1) when no filters are present.
PredicateGroup Build()Materializes the current predicate state into a logical group suitable for SQL generation.
Task<int> ExecuteAsync(CancellationToken cancellationToken = null)Executes the UPDATE statement using the session bound to this builder.
Task<int> ExecuteAsync(IDatabaseSession session, CancellationToken cancellationToken = null)Executes the UPDATE using the specified session.
UpdateSetBuilder<T> Set(Expression<Func<T, T>> initializer)Adds assignments using an object initializer expression.
UpdateSetBuilder<T> Set(Expression<Func<T, TProp>> selector, TProp value)Adds or replaces a single assignment in the SET clause using a mapped property selector.
UpdateSetBuilder<T> Set(ValueTuple<Expression<Func<T, TProp>>, TProp>[] sets)Adds or replaces multiple assignments in the SET clause using mapped property selectors.
UpdateStatement ToSql(IConnection connection)Builds an UPDATE statement using the connection's SQL generator.
UpdateStatement ToSql(ISqlGenerator generator)Builds an UPDATE statement using the specified SQL generator.

Remarks ​

This builder is immutable: each call to Set or the multi-assignment Set overload returns a new builder instance containing the updated assignments, leaving the original instance unchanged.

The WHERE clause is derived from the underlying QueryBuilderCore state (see Build). The SET clause is derived from the current Assignments.

Execution requires either a bound IDatabaseSession or an explicit session passed to ExecuteAsync.