Database.RemoveKeyAsync<TEntity> Method
Executes a DELETE command for the entity whose primary key matches the id parameter.
Namespace: DbExtensions
Assembly: DbExtensions.dll
Syntax
public ValueTask<bool> RemoveKeyAsync<TEntity>(
Object id,
CancellationToken cancellationToken = default
)
where TEntity : class
Parameters
id Object
The primary key value.
cancellationToken CancellationToken (Optional)
The CancellationToken to monitor for cancellation requests. The default is None.
Type Parameters
TEntity
Return Value
ValueTask<Boolean>
true
if a record that matches id was found and deleted; otherwise, false
.
Remarks
This method is a shortcut for await db.Table<TEntity>().RemoveKeyAsync(id, cancellationToken)
.
See Also
Reference
Database Class
DbExtensions Namespace
SqlTable<TEntity>.RemoveKeyAsync(Object, CancellationToken)