Table of Contents

Interface IUpsertInsertSpec<TTarget>

Namespace
LinqToDB.Linq
Assembly
linq2db.dll

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

public interface IUpsertInsertSpec<TTarget> : IEntityInsertSpec<TTarget, IUpsertInsertSpec<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 INSERT branch as explicitly empty.

IUpsertInsertSpec<TTarget> DoNothing()

Returns

IUpsertInsertSpec<TTarget>

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

Adds a source-row predicate: insert only when the predicate holds (WHEN NOT MATCHED AND …).

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

Parameters

condition Expression<Func<TTarget, bool>>

Returns

IUpsertInsertSpec<TTarget>