delete method
The delete
method deletes an existing entity.
Implementation
@override
FutureOr<void> delete(
TaskModel entity, {
bool createOpLog = true,
}) async {
final updated = entity.copyWith(
isDeleted: true,
rowVersion: entity.rowVersion,
);
await sql.batch((batch) {
batch.update(
sql.task,
updated.companion,
where: (table) => table.clientReferenceId.equals(
entity.clientReferenceId,
),
);
});
return super.delete(updated);
}