title: ASP.NET Core 3 API routing
body: <p>So I've created an API project using .NET Core 3 and inside the project I've created a Controller like so:</p>
  <pre><code>[Route(&quot;api/account&quot;)]
  [ApiController]
  public class AccountController : ControllerBase
  {
     public IActionResult Hello()
     {
        return Ok(&quot;Hello&quot;);
     }
  }
  </code></pre>
  <p>In my <code>Startup.cs</code> I have:</p>
  <pre><code>public class Startup
  {
     public IConfiguration Configuration { get; }
  
     public Startup(IConfiguration configuration)
     {
        Configuration = configuration;
     }
  
     public void ConfigureServices(IServiceCollection services)
     {
        services.AddControllers();
     }
  
     public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
     {
        app.UseRouting();
        app.UseEndpoints(endpoints =&gt;
        {
           endpoints.MapControllers();
        });
      }
  }
  </code></pre>
  <p>From what I understand, the line <code>services.AddControllers();</code> picks up every controller in my api project. I remember in asp.net to add controllers you would have to call this line:</p>
  <p><code>services.AddTransient&lt;AccountController&gt;();</code></p>
  <p>You would have to namely add each controller, is there no way to do this in .NET Core 3?</p>