locked
Refreshing Entities with the entity Framework RRS feed

  • General discussion

  • 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 type Marco Zhou Monday, March 30, 2009 5:04 AM off topic, EF question indeed
    Tuesday, March 24, 2009 9:23 PM

All replies

  • 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.

    Thanks

    Another Paradigm Shift
    http://shevaspace.blogspot.com
    Friday, March 27, 2009 7:12 AM
  • Good point.  I suppose it is an EF question. 

    I will repost elsewhere.
    Friday, March 27, 2009 2:14 PM