Using the Entity Framework, I try to keep by Data Context as atomic as possible. But I am having problems refreshing my entities in a context.
In one instance, I have a search form which lists transactions from my database. The constructor of the form creates a new DataContext, which is then disposed of when the form closes.
While viewing the list of transactions the user can edit an existing transaction or create new ones. To perform the edit or creation of new transactions I call out to a new dialog window, which creates its own Datacontext and Submits the changes (or disposes changes) when closing.
When returning to the parent form, I can refresh the entity for an existing transaction, my list will update with transaction details, although child details, such as the count of line items on an invoice will NOT update.
Also, when I create a NEW transaction I am unable to get the details into my list of transactions until I close the page and reopen it.
How can I get the new transaction details in my list without reloading the window?
Changed typeMarco ZhouMonday, March 30, 2009 5:04 AMoff topic, EF question indeed
Could you please confirm if you are asking a WPF question or Entity Framework question? if you are asking a WPF question, please elaborate which specific WPF issue you are encountering.