title: Using a combination of MapWhen and ApplicationBuilder in .net core app startup?
body: <p>Is it possible to have partially a branching startup?</p>
  
  <p>As an example, is it possible to have something like:</p>
  
  <pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env)
  {
      app.AlwaysUseThisMiddleware();
      app.MapWhen(conditionA, appBuilder =&gt; {appBuilder.SometimesUseThisOne;})
      app.MapWhen(conditionB, appBuilder =&gt; {appBuilder.SometimesUseThisOtherOne;})
  </code></pre>
  
  <p>Or do I need to put the <code>AlwaysUseThisMiddleware</code> inside each branching? Like so:</p>
  
  <pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env)
  {
      app.MapWhen(conditionA, appBuilder =&gt;
      {
          appBuilder.AlwaysUseThisMiddleware(); // Duplicated
          appBuilder.SometimesUseThisOne;
      )
      app.MapWhen(conditionB, appBuilder =&gt;
      {
          appBuilder.AlwaysUseThisMiddleware(); // Duplicated
          appBuilder.SometimesUseThisOtherOne;
      )
  </code></pre>