title: Create two singleton services that implement the same interface
body: <p>I have an ASP.NET Core project (my first) that requires two internal "sequencers" for specific tasks. The first was implemented like this:</p>
  
  <p>In Startup.cs ConfigureServices method:</p>
  
  <pre><code>services.AddSingleton&lt;ISequencer, ProfileSequencer&gt;();
  </code></pre>
  
  <p>And of course I have the interface and implementation defined, and it's working well. However I'm not sure how to add the second sequencer, which implements the same interface but has a slightly different implementation.</p>
  
  <pre><code>services.AddSingleton&lt;ISequencer, ChargeSequencer&gt;();
  </code></pre>
  
  <p>ASP.NET doesn't complain about this, but now when I inject ISequencer into my classes, I can't imagine how it knows which singleton to use. I suspect (but don't know for sure) that the second singleton effectively replaces the first.</p>
  
  <p>There is probably some bad design decision here, so I'll accept an answer that describes how I can inject two different singletons that implement the same interface, or if necessary another reasonable approach to this problem. Thanks!</p>