title: .NET 6 how to call configure method
body: <p>I have in .net 5 a <code>Configure</code> method which is called by runtime</p>
  <pre><code>public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IEventBusSubscriber bus){}
  </code></pre>
  <p>In the migration guide it is shown an example how to call it</p>
  <pre><code>var app = builder.Build();
  startup.Configure(app, app.Environment);
  </code></pre>
  <p>I can pass to this method an <code>app</code> and <code>env</code>  because I have an <code>app</code> instance, but what to do with <code>IEventBusSubscriber</code>?</p>
  <p>Perhaps I could use <code>app.Services.GetService(typeof(IEventBusSubscriber)) as IEventBusSubscriber</code>
  but it gives me possible null reference which I can avoid, but is it the right way to do it?</p>