title: Add/Skip ApiController for Web API in .Net Core
body: <p>I have created windows forms application in .netcore 3.1 , that host two WEB Api services, using <code>WebHostBuilder</code> from the framework dependence of AspNetCore 3.1. (one on port 5000, one on 5001).</p>
  <p>I have also created two ApiControllers, with annotations:</p>
  <p><code>[Route(&quot;api/[controller]&quot;)]</code>
  <code>[ApiController]</code></p>
  <p>And the second one:</p>
  <p><code>[Route(&quot;api2/[controller]&quot;)]</code>
  <code>[ApiController]</code></p>
  <p>In both Startup classes, I am setting:</p>
  <p><code>services.AddControllers();</code></p>
  <p>and later:</p>
  <p><code>endpoints.MapControllers()</code></p>
  <p>And it works like a charm.</p>
  <p>Now I want to the first controller to be accessible only to port 5000, and the second only to 5001.
  And the runtime is adding both of them, to the both WEB Api.</p>
  <p>So for example:</p>
  <p>First Api (at port 5000)</p>
  <p>...:5000/api/ - works!</p>
  <p>...:5000/api2/ - 404!</p>
  <p>Second Api (at port 5001)</p>
  <p>...:5001/api/ - 404!</p>
  <p>...:5001/api2/ - works!</p>
  <p>Is there a way to register specific controller to specific WEB Api, instead of adding everything that is inside your project?</p>
  <p>For example, add only controllers, that start with route &quot;api/&quot; or any in specific namespace, or ...any way whatsoever...</p>