Appearance
UpsertAsync Method
Definition
- Namespace:
JASE.Database - Assembly:
JASE.Database.dll
Overloads
| Name | Description |
|---|---|
Task<bool> UpsertAsync(T item, int commandTimeout = null, CancellationToken cancellationToken = null, UpsertConflictAction conflictAction = null) | Inserts or updates a record depending on whether it already exists. |
Task<bool> UpsertAsync(Type entityType, object item, int commandTimeout = null, CancellationToken cancellationToken = null, UpsertConflictAction conflictAction = null) | Inserts or updates a record using a runtime entity type. |
Task<bool> UpsertAsync(Type entityType, object item, int commandTimeout = null, CancellationToken cancellationToken = null, UpsertConflictAction conflictAction = null)
csharp
Task<bool> UpsertAsync(Type entityType, object item, int commandTimeout = null, CancellationToken cancellationToken = null, UpsertConflictAction conflictAction = null)Inserts or updates a record using a runtime entity type.
Task<bool> UpsertAsync(T item, int commandTimeout = null, CancellationToken cancellationToken = null, UpsertConflictAction conflictAction = null)
csharp
Task<bool> UpsertAsync(T item, int commandTimeout = null, CancellationToken cancellationToken = null, UpsertConflictAction conflictAction = null)Inserts or updates a record depending on whether it already exists.
Type parameters
| Name | Description |
|---|---|
T | The entity (row) type. |
Parameters
| Name | Description |
|---|---|
cancellationToken | Cancellation token. |
commandTimeout | Command timeout in seconds. Use -1 for provider default. |
conflictAction | Behavior when the primary key already exists. |
item | Item to insert or update. |
Returns
true if the operation succeeded; otherwise false.