title: What design pattern is preferable when working with ASP.Net MVC and Entity Framework?
body: <p>I am not very sure what design pattern is the most efficent to use when working with ASP.Net MVC and the Entity Framework, so any guidance is much appreciated!</p>
  
  <p>Would you store the context in the Controller-class, or is it better to create a repository?</p>
  
  <p>If you would recommend the repo-design, is it required to initialize the context in each method, like this? Or is it a better way to do this?:</p>
  
  <pre><code>public SomeEntity GetEntity(Guid id) {
     using(Context ctx = new Context()) {
        // code here...
     }
  }
  </code></pre>