title: Dependency Injection and Scope?
body: <p>I am working the the latest ASP.Net Core RC2, Web API, targeting Windows only. Framework 4.6.1.</p>
  
  <p>I'm confused as to the role of the standard repository pattern is versus the way Core handles controller dependency injection.  I just want to make sure this is the right approach still, as there is not much documentation out there (or it will contradict).</p>
  
  <p>The way I have this set up now, I have a standard repository interface for CRUD operations and the associated class that implements these operations.</p>
  
  <p>I am injecting the <em>repository</em> into the controller.  The two steps I have taken are (in <code>Startup.cs</code>, <code>ConfigureServices()</code>): </p>
  
  <pre><code>services.AddSingleton&lt;IMyCustomRepository, MyCustomRepository&gt;();
  </code></pre>
  
  <p>My controller then is taking in the repository:</p>
  
  <pre><code>public MyCustomController(IMyCustomRepository repository) { }
  </code></pre>
  
  <p>My end goal is to get EF Core in here, including the InMemoryProvider.   </p>
  
  <p>Is this built correctly so far?  One of my main concerns is that I constantly am reading about how repository patterns are not necessary when using ORMs like Entity Framework, but am unsure how this applies to EF Core.</p>
  
  <p>I've read that you are not supposed to use the AddSingleton here if you are using EF Core, because that depends on a DbContext which is Scoped (so you should use that instead)?</p>