I use DataSet to write to the database in my desktop WPF application.
I create one DataSet for one Survey Window that contains several different documents. I add some starting data (add new rows to several tables) then I bind it to the appropriate fields (TextBoxes, CheckBoxes).
Now DataSet has changes, but I can reset them:
dataSet.AcceptChanges();
Than, when a user change something, I can track the changes using:
dataSet.HasChanges();
dataSet.GetChanges();
I would like to transfer the application to Entity Framework.
I found that I could bind to dbContext.MyTable.Local
, and check changes by dbContext.ChangeTracker.HasChanges()
. However, I can't find a way to add some data and reset HasChanges() status.
Is this possible to using model and classes generated by EF without open connection to database?
Should I build my own model and use EF only for writing to the database?