delete method

  1. @override
Future<E> delete(
  1. E entity, {
  2. DeleteOptions? options,
  3. TransactionContext? transaction,
})
override

Deletes an entity.

Returns the deleted entity. Throws a RepositoryException if an error occurs. An optional options parameter can be provided to customize the delete behavior.

Implementation

@override
Future<E> delete(
  E entity, {
  DeleteOptions? options,
  TransactionContext? transaction,
}) async {
  if (transaction != null) {
    throw TransactionException(
      'Transaction is not supported in StorageRepository',
    );
  }

  await deleteById(entity.id);
  return entity;
}