title: Binding query to datagrid with WPF and Entity Framework
body: <p>Ok, so what I have is a datagrid in wpf that I want to bind to the results of a linq query using the entity framework. For instance, lets say I have a list of products and I want to display only products on sale:</p>
  
  <pre><code>var itemsOnSale = from item in context.products 
         where item.onSale == true 
         select item;
  context.products.Load();
  productViewSource.Source = itemsOnSale.ToList();
  </code></pre>
  
  <p>But here's the catch: I also want to be able to add/edit the products on sale directly in the datagridview and save the changes to the database. How would I go about doing this?</p>
  
  <p>Thanks in advance. </p>