I have a Winforms test application that I'm using to try to learn about Entity Framework Core.
I have a datagridview bound to my table and I can edit fields and call context.SaveChanges()
- works fine.
What if I have edited several cells on different rows, deleted and added a row, then changed my mind and I don't want to save? How can I discard the changes and refresh the datagridview with the original data?
I call EntityFrameworkQueryableExtensions.Load(context.entity)
and then dataGridView1.Refresh()
but my form remains unchanged with my changes.
dataGridView1.DataSource = context.enity.Local.ToBindingList();