title: .NET Core 2.0 Modular Dependency Injection
body: <p>I am trying to build a library that has core and extensions packages like Entity Framework and its database providers.</p>
  
  <p>What I am trying to do is when I register that library with dependency injection, I want to give specific implementation as a parameter.</p>
  
  <p>Think EF. In order to use sql provider on EF we need to register it with SQL provider passed as option parameter like the following.</p>
  
  <pre><code>services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt;
  {
     options.UseSqlServer(Configuration["ConnectionString"]);
  });
  </code></pre>
  
  <p>I would like to build similar structure. Lets say my framework will provide film producer. It will have <code>producer.core</code> package for framework related classes and two extensions package called <code>Producer.Extensions.Hollywood</code> and <code>Producer.Extensions.Bollywood</code>.</p>
  
  <p>If I want to use <code>Hollywood</code> provider, I need to install core package and <code>Hollywood</code> extension package. On registration it should look like </p>
  
  <pre><code>services.AddFilmProducer(options =&gt;
  {
     options.UseHollywoodProducer();
  });
  </code></pre>
  
  <p>I could not find even a keyword that will point me a direction. I tried to read entity framework's source code but it is too complicated for my case.</p>
  
  <p>Is there anyone who could point me a direction?</p>
  
  <p>Thanks in advance.</p>