Install-Package SoftDelete -Version 1.1.1
dotnet add package SoftDelete --version 1.1.1
<PackageReference Include="SoftDelete" Version="1.1.1" />
paket add SoftDelete --version 1.1.1
#r "nuget: SoftDelete, 1.1.1"
// Install SoftDelete as a Cake Addin #addin nuget:?package=SoftDelete&version=1.1.1 // Install SoftDelete as a Cake Tool #tool nuget:?package=SoftDelete&version=1.1.1
Ef Core Soft Delete implementation
A very simple implementation for soft deleting entities in Ef Core library.
Extend your application db context from
In entities you want to add soft delete support, implement
It will a column named
DeletedAt to your entity so you need to add a migration and update the database tables.
Load relations you want to delete in soft deleting the entity in
Delete relations you want to delete in soft deleting the entity in
For soft deleting an entity use
RemoveAsync methods. These methods will
soft delete an
ISoftDelete implemented entity and force delete an not implemented entity.
For force deleting any entity use
It doesn't support
DbSet yet, so you have to use
SoftDeletes.Core.DbContext methods for removing
instead of using
An interface for saving
UpdatedAt date and time of entities.
You can implement it in your entities. That will add to columns named
UpdatedAt to your entities.
ModelExtenstion abstract class:
An abstract class that implements
You can use it in your entities.
sample project for this implementation.
If you like it, you can donate BTC(bitcoin) to this wallet
The proposal for this implementation.
- Microsoft.EntityFrameworkCore (>= 3.1.5)
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.