![]() |
VOOZH | about |
dotnet add package EFCore.SoftDelete --version 1.3.0
NuGet\Install-Package EFCore.SoftDelete -Version 1.3.0
<PackageReference Include="EFCore.SoftDelete" Version="1.3.0" />
<PackageVersion Include="EFCore.SoftDelete" Version="1.3.0" />Directory.Packages.props
<PackageReference Include="EFCore.SoftDelete" />Project file
paket add EFCore.SoftDelete --version 1.3.0
#r "nuget: EFCore.SoftDelete, 1.3.0"
#:package EFCore.SoftDelete@1.3.0
#addin nuget:?package=EFCore.SoftDelete&version=1.3.0Install as a Cake Addin
#tool nuget:?package=EFCore.SoftDelete&version=1.3.0Install as a Cake Tool
A very simple implementation for soft deleting entities in Ef Core library.
EFCore.SoftDelete and SoftDelete are both based on this repository, both will get updates and will be maintained
Extend your application db context from SoftDeletes.Core.DbContext.
In entities you want to add soft delete support, implement SoftDeletes.ModelTools.ISoftDelete
interface.
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 LoadRelationsAsync and LoadRelations methods.
Delete relations you want to delete in soft deleting the entity in OnSoftDeleteAsync and OnSoftDelete methods.
For soft deleting an entity use Remove and RemoveAsync methods. These methods will
soft delete an ISoftDelete implemented entity and force delete an not implemented entity.
For force deleting any entity use ForceRemove method.
For restoring soft-deleted entities, you can use Restore and RestoreAsync methods.
Note that this methods will no longer call SaveChanges method. For better performance, you should manually call SaveChanges method.
It doesn't support DbSet yet, so you have to use SoftDeletes.Core.DbContext methods for removing instead of using DbSet methods.
ITimestamps interface:An interface for saving CreatedAt and UpdatedAt date and time of entities.
You can implement it in your entities. That will add to columns named
CreatedAt and UpdatedAt to your entities.
ModelExtenstion abstract class:An abstract class that implements ITimestamps and ISoftDelete interfaces.
You can use it in your entities.
sample project for this implementation.
If you like it, you can support me with USDT:
TJ57yPBVwwK8rjWDxogkGJH1nF3TGPVq98 for USDT TRC200x743379201B80dA1CB680aC08F54b058Ac01346F1 for USDT ERC20The proposal for this implementation.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.3.0 | 8,567 | 1/10/2022 | |
| 1.1.1 | 1,749 | 7/24/2020 | |
| 1.1.0 | 960 | 7/18/2020 | 1.1.0 is deprecated because it has critical bugs. |
| 1.0.1 | 720 | 7/18/2020 | |
| 1.0.0 | 1,043 | 7/8/2020 | 1.0.0 is deprecated because it has critical bugs. |