title: Using the same DbContext object across different controllers
body: <p>I am coding a MVC 5 internet application &amp; have a question in regards to using the same instantiated <code>DbContext</code> object across different controllers.</p>
  
  <p>I am wanting to do this because i am retrieving some of the same data in different controllers, &amp; the inbuilt caching feature of the <code>DbContext</code> class will minimize many database transactions.</p>
  
  <p>Here is some code to explain:</p>
  
  <pre><code>public class TestController1 : Controller
  {
      private CanFindLocationDatabaseContext db = new CanFindLocationDatabaseContext();
  }
  
  public class TestController2 : Controller
  {
      private CanFindLocationDatabaseContext db = new CanFindLocationDatabaseContext();
  }
  </code></pre>
  
  <p>What would be the best way to code this and are there any disadvantages to this? Should each user have their own DbContext object, or only one for all users? What should I be aware of before coding this? Could potential conflicts occur when CRUD actions occur?</p>
  
  <p>Thanks in advance.</p>