-
Notifications
You must be signed in to change notification settings - Fork 3.3k
End-to-end soft delete #19695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@ajcvickers This is my proposal for #21524 issue as an implementation for soft deletes. sorry my writing skills for English language is not very good. |
@AshkanAbd we usually just post design proposals in their relevant github issues, in Markdown - this is easiest to access for everyone and ensures the content never goes away. I haven't given your document a thorough read, but on principle EF Core generally does not require entities to implement interfaces or inherit from base classes to provide functionality. Any proposal which requires this goes against the current design of the library. |
@roji I understand that but this proposal is not just an idea for an implementation, its the best implementation after several projects. I have been tried other implementations in several projects for this feature and because of feedbacks I get from my friends and other developers, I choose this one, other implementations that I have been tried, was really confusing for developers, they were not easy to add or remove from the project. I can implement relations need to delete in "DbContext" but its not clean enough in the project or "OnSoftDelete" for each entity needs to define in the entity's class. Also, soft deletes needs to modify entities because of "DeletedAt" property. Please note that soft deletes is an really useful and important feature that needs to implement in a framework like .Net Core, there is no Nuget package or an implementation that really works. One of reasons that other developers don't want to use EF Core is that the library doesn't support soft deletes. You may need to add some exceptions in the current design of the library. |
@AshkanAbd I agree with @roji. I don't think this is kind of implementation belongs in the main EF Core codebase. That being said, if you feel that this would be useful to people, then I encourage you to ship it as an extension to EF Core in a NuGet package. It can then be added to https://docs.microsoft.com/en-us/ef/core/extensions/ to help other people find it. |
Duplicate of #4025 |
(Thought we had this on the backlog, but couldn't find it.)
Query filters provide most of the underlying functionality for soft deletes, but they don't allow things like automatically updating an entity to set the flag instead of deleting it. This issue is about making a good end-to-end experience for this.
The text was updated successfully, but these errors were encountered: