Reputation: 439
I have a WPF application using Entity Framework and two views:
Considering the following scenario:
How the selected product's bindings in the product list would be notified?
In a memory context:
Since it's the same reference I don't need to do anything to the product list be updated.
I don't see how I could do the same thing using EF context.
Any sugestions?
Upvotes: 0
Views: 442
Reputation: 13898
In EF Context, I would suggest you keep the DbContext across all 4 actions. This will save you a lot of hastle.
Not unless your products data is very large and you only retrieve the title and id lets say in initial list fetch, then keep the same DbContext open from time they open EditView till they close it. And if they save, EF will find the changes.
It finds changes by comparing the values it retrieved from database, to the values currently set to the entity. By closing the entity context, you are getting rid of the OriginalValues
.
Upvotes: 1