Microsoft Developer Network > Forums Home > Archived Forums Forums > LINQ Project General > Query Data That Has Not Yet Been Persisted
Ask a questionAsk a question
 

AnswerQuery Data That Has Not Yet Been Persisted

  • Thursday, November 05, 2009 3:08 PMheasty Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello everyone.  I am new to LINQ, and had a question about querying records that have been added to my data conxtext (via insertonsubmit) but not yet persisted to my sql database.

    Here's the scenario:

    I'm building a WPF application that handles basic case management.  During the course creating a case, a user can add multiple persons.  I would like to be able to add person objects to my data context and display the names of the newly added (but not yet inserted into the database) persons in a list box.

    My current linq query to retrieve the person names will not return data unless it has been persisted to my database, which I understand is by design.  However, is there a way to query the records that have been added to my data context but not yet persisted to my database?

Answers

All Replies