title: asp.net core - create an instance of a class after the app started
body: <p>I have some classes which should be instantiated after the app started. In my case, some controller can trigger an Event and I want <code>EventPublisher</code> to already have Subscribers by that moment.</p>
  
  <pre><code>class SomeEventHandler {
     public SomeEventHandler(EventPublisher publisher) {
        publisher.Subscribe(e =&gt; {}, SomeEventType);
     }
  }
  
  class SomeController : Controller {
     private EventPublisher _publisher;
     public SomeController(EventPublisher publisher) {
        _publisher = publisher;
     }
     [HttpGet]
     public SomeAction() {
        _publisher.Publish(SomeEventType);
     }
  }
  </code></pre>
  
  <p>Is it possible to have an instance of <code>SomeEventHandler</code> by the time the <code>Publish</code> method is called?</p>
  
  <p>Or maybe there are much better solutions?</p>