title: Does WPF break an Entity Framework ObjectContext?
body: <p>I am getting started with Entity Framework 4, and I am getting ready to write a WPF demo app to learn EF4 better. My LINQ queries return <code>IQueryable&lt;T&gt;</code>, and I know I can drop those into an <code>ObservableCollection&lt;T&gt;</code> with the following code:</p>
  
  <pre><code>IQueryable&lt;Foo&gt; fooList = from f in Foo orderby f.Title select f;
  var observableFooList = new ObservableCollection&lt;Foo&gt;(fooList);
  </code></pre>
  
  <p>At that point, I can set the appropriate property on my view model to the observable collection, and I will get WPF data binding between the view and the view model property.</p>
  
  <p>Here is my question: Do I break the ObjectContext when I move my foo list to the observable collection? Or put another way, assuming I am otherwise handling my ObjectContext properly, will EF4 properly update the model (and the database)?</p>
  
  <p>The reason why I ask is this: NHibernate tracks objects at the collection level. If I move an NHibernate <code>IList&lt;T&gt;</code> to an observable collection, it breaks NHibernate's change tracking mechanism. That means I have to do some very complicated object wrapping to get NHibernate to work with WPF. I am looking at EF4 as a way to dispense with all that.</p>
  
  <p>So, to get EF4 working with WPF, is it as simple as dropping my <code>IQueryable&lt;T&gt;</code> results into an <code>ObservableCollection&lt;T&gt;</code>. Does that preserve change-tracking on my EDM entity objects? Thanks for your help.</p>