Table of Contents

Interface IUpsertUpdateSpec<TTarget>

Namespace
LinqToDB.Linq
Assembly
linq2db.dll

Fluent configuration builder for the UPDATE branch of an Upsert operation. Inherits Set (3 overloads) / Ignore from IEntityUpdateSpec<TTarget, TBuilder> (with itself substituted as TBuilder, so chain methods return IUpsertUpdateSpec<TTarget>) and adds the Upsert-only chain methods When(Expression<Func<TTarget, TTarget, bool>>) / DoNothing(), which have no SQL meaning outside MERGE / ON CONFLICT.

public interface IUpsertUpdateSpec<TTarget> : IEntityUpdateSpec<TTarget, IUpsertUpdateSpec<TTarget>> where TTarget : notnull

Type Parameters

TTarget

Target table record type.

Inherited Members
Extension Methods

Remarks

This interface is used only as the receiver type of an expression tree captured by linq2db. The configure expression is parsed by linq2db and is not invoked; implementing this interface is not a supported extension point.

Methods

DoNothing()

Marks the UPDATE branch as explicitly empty.

IUpsertUpdateSpec<TTarget> DoNothing()

Returns

IUpsertUpdateSpec<TTarget>

When(Expression<Func<TTarget, TTarget, bool>>)

Adds a target/source-row predicate: update only when the predicate holds (WHEN MATCHED AND …).

IUpsertUpdateSpec<TTarget> When(Expression<Func<TTarget, TTarget, bool>> condition)

Parameters

condition Expression<Func<TTarget, TTarget, bool>>

Returns

IUpsertUpdateSpec<TTarget>