DmUpsertOptions`1
Namespace: MJCZone.DapperMatic.Dml
Assembly: MJCZone.DapperMatic
Summary
How an upsert finds a conflicting row and what it does to it.
sealed public
Contents
Constructors (1) | Methods (4) | Properties (4)
Constructors
DmUpsertOptions`1
DmUpsertOptions`1()Methods
GetType
GetType()ToString
ToString()Equals
Equals()GetHashCode
GetHashCode()Properties
OnConflict
Gets the columns a conflicting row has the same values in, <c>u => u.Email</c> or <c>s => new { s.Day, s.Page }</c>; null for the primary key. They must be the primary key or the columns of a unique constraint or index, which PostgreSQL and SQLite need. MySQL and MariaDB update on a duplicate of any unique key.
Type: Expression<Func<T, object?>>?
OnConflictConstraint
Gets the name of the unique constraint or index a conflicting row violates, in place of OnConflict.
Type: string?
Update
Gets the columns to set on a conflicting row, from the row as it is and the row being upserted: <c>(current, incoming) => new PageStat { Views = current.Views + incoming.Views }</c>. Null sets every column but the key and the conflict columns to the incoming row's values.
Type: Expression<Func<T, T, T>>?
UpdateWhere
Gets a condition a conflicting row is updated only when it holds: <c>(current, incoming) => incoming.Version > current.Version</c>. When it does not, the row is left as it is.
Type: Expression<Func<T, T, bool>>