Skip to content

Implement RejectChanges() in DbContext #14594

@ice1e0

Description

@ice1e0

Story

There are many user requests for a function in DbContext class to reject or discard changes. See as well:

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions