- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3.3k
Closed as not planned
Labels
Description
Story
There are many user requests for a function in DbContext class to reject or discard changes. See as well:
- https://stackoverflow.com/questions/5466677/undo-changes-in-entity-framework-entities
- https://stackoverflow.com/questions/16437083/dbcontext-discard-changes-without-disposing/16437305
Microsoft sample code: How to undo the changes in Entity Framework 4.1 and later
I first implemented a wrong version which I found online which caused terrible data loss. I was able to fix it with a similar solution as the Microsoft sample code is, see above.
Request
I would appreciate if a function DbContext.RejectChanges() or a similar one would be implemented in the official version of Entity Framework Core.
Further technical details
EF Core version: 2.1.4
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows
IDE: Visual Studio 2017 15.8.6