Services to provide simple soft delete and cascade soft delete in EF Core
This library to provide simple soft delete and cascade soft delete in EF Core. It provides:
Remove
method) a entity class, but only if it is already Soft Deleted.byte
value.MIT License. Documentation can be found in the Repo's Wiki. NuGet available at EfCore.SoftDeleteServices.
There are older versions of the EfCore.TestSupport library, but .NET lower than .NET 5 are not supported by Microsoft.
Here is an image to show the difference between normal (single) soft delete and cascade soft delete.
The cascade soft delete is pretty clever, and can handle multi-level soft deletes - see this section from my article EF Core In depth - Soft deleting data with Global Query Filters.
All of these limitations could be removed, but it takes time to implement and check.
Remove
method. A hard delete removes the row from the database and may effect other entities/rows.DeleteBehavior
has an effect on what happens).