1

I'm converting a .net program's db access from old school sql to EntityFramework currently it has an 'undo redo' feature by holding the sql scripts in a container for later use.

Is there an easy way to implement undo redo mechanism with entity framework?

Thank you very much Rony

--EDIT-- I think I didn't explain myself properly.. I need to keep all history to my SQL SELECT queries. In the previous app I kept such list of all my queries and this allowed me to perform any number of undo / redo steps.

3 Answers3

1

You can implement such behavior taking advantage of DbContext's Property Values. This ADO.NET team blog article explains it in good detail: Using DbContext in EF 4.1 Part 5: Working with Property Values

Nano Taboada
  • 4,148
  • 11
  • 61
  • 89
0

For this you have to use SaveChanges(false) and AcceptAllChanges() function.

Check This out here is the explanation of your problem.

Hope this will be helpful for you.

Community
  • 1
  • 1
Syeda
  • 1,215
  • 11
  • 23
-1

This new O/R-Mapping-Framework with included Model-View-Controller-Framework supports Undo-Management.