title: In practice, should Contexts (Entity Framework) be used in controllers or in another layer of abstraction?
body: <p>I'm currently learning .Net MVC with C#. I'm very curious as to how people use their Entity Framework contexts. Several related questions are listed below. I hope you can provide feedback.</p>
  
  <ol>
  <li><p>Should contexts be instantiated in controllers? In models? In another layer of abstraction altogether? What would be the proper encapsulation?</p></li>
  <li><p>When doing simple CRUD operations, should the call to say context.Add(entity) be called in the controller?</p></li>
  <li><p>When creating queries to the context, should these queries be done in the controller? Or in the model? Should these use static methods if used in the model?</p></li>
  </ol>
  
  <p>I hope my questions are quite clear. In general I'm interested how one should interact with a database, and how to abstract that properly from the application. Any info or advice related to that is welcome.</p>