title: Repository Pattern with Entity Framework 3.5 and MVVM - Should I share the same context everywhere?
body: <p>I am developing a <a href="https://stackoverflow.com/questions/1575155/what-is-a-database-file-system">Database File System</a>.
  I am using - </p>
  
  <ol>
  <li>.Net framework 3.5 </li>
  <li>Entity Framework 3.5</li>
  <li>WPF with MVVM pattern</li>
  </ol>
  
  <p>The project spans across multiple assemblies each using same model.</p>
  
  <p>One assembly,let's call it a "server", only adds data to the database using EF i.e. same model.Other assemblies (including the UI) both reads and writes the data.The changes made by server should immediately reflect in other assemblies.</p>
  
  <p>The database contains self referencing tables where each entity can have single OR no parent and (may be) some children. I want to use repository pattern which can also provide some mechanism to handle this hierarchical nature.</p>
  
  <p>I have already done reading on this on <a href="http://www.codeproject.com/KB/database/ImplRepositoryPatternEF.aspx" rel="nofollow noreferrer">Code Project</a>. It shares the same context(entities) everywhere.</p>
  
  <p>My question is - Should I share the same context everywhere? What are the advantages and disadvantages of doing that?</p>