Architecture & Tech Stack

How does soft-delete work (IsDeleted + global query filter)?

Records are never hard-deleted in normal operation; instead the IsDeleted flag on BaseEntity is set to true. A global query filter in the EF Core model automatically adds "where IsDeleted = 0" to every query for every entity, so deleted rows simply disappear from all normal reads without each query having to remember to exclude them. This means a "delete" in the UI is reversible and…

Records are never hard-deleted in normal operation; instead the IsDeleted flag on BaseEntity is set to true. A global query filter in the EF Core model automatically adds "where IsDeleted = 0" to every query for every entity, so deleted rows simply disappear from all normal reads without each query having to remember to exclude them. This means a "delete" in the UI is reversible and auditable (the row, with its CreatedBy/ModifiedBy trail, still exists), foreign-key history stays intact (an order line still references its product even if that product was "deleted"), and accidental deletion doesn't cascade into data loss. True physical deletion is reserved for explicit, guarded maintenance operations like the data-erase tool.