Recycle Bin
This page covers the recycle bin (soft delete) capability in EasyAdminBlazor: records are not physically deleted, they can be restored, and they can be permanently deleted when needed.
Overview
- Soft delete: entities implementing
IEntitySoftDelete(theEntityFullfamily) are only marked withIsDeleted = truewhen deleted — the row stays in the database. - Automatic filtering: a global filter excludes soft-deleted rows, so normal lists, queries and statistics never show deleted records.
- Recycle bin entry: the admin table toolbar shows a Recycle Bin toggle, and only soft-delete entities get this entry.
- Restorable: records in the recycle bin can be restored back to the normal list.
- Permanent delete: rows are only physically removed after an explicit confirmation.
Usage
1. Make an entity soft-deletable
Inherit from EntityFull (or implement IEntitySoftDelete):
public class Product : EntityFull
{
public string Name { get; set; } = string.Empty;
}
2. Delete a record
Clicking delete in the admin page moves the record to the recycle bin instead of removing it from the database.
3. Open the recycle bin
Click Recycle Bin in the page toolbar to switch the list to soft-deleted rows only; click it again to return to the normal list.
4. Restore or permanently delete
- Restore: select rows and restore them —
IsDeletedis set back tofalseand the records reappear in the normal list. - Bulk restore: multi-select and restore in one go.
- Permanent delete: requires a second confirmation; only then is the row physically removed and unrecoverable.
Interface Description
- Toolbar toggle: enter/exit recycle bin mode. In recycle bin mode, add/import entries are hidden to avoid mistakes.
- Recycle bin list: shows deleted rows only, with restore and permanent-delete actions.
- Confirmation dialog: permanent deletion always asks for confirmation.
Notes
- The recycle bin is built into AdminTable — no extra development is needed, just make the entity soft-deletable.
- Entities without soft delete are physically deleted and never appear in the recycle bin.
- Deleted rows still occupy database space; use permanent delete to clean them up.