title: Blazor API default controllers route maping
body: <p>How to force Blazor Web API so it to map as it was in some previous .NET Framework?</p>
  <p>If I have this <code>UserController</code>:</p>
  <pre><code>[Route(&quot;api/[controller]&quot;)]
  [ApiController]
  public class UserController : Controller
  {
      private readonly IHttpContextAccessor httpContextAccessor;
      private readonly IConfiguration configuration;
  
      public UserController(IHttpContextAccessor httpContextAccessor)
      {
          this.httpContextAccessor = httpContextAccessor;
      }
  
      [HttpGet]
      [Authorize(AuthenticationSchemes = NegotiateDefaults.AuthenticationScheme)]
      [Route(&quot;GetUserName&quot;)]
      public String GetUserName()
      {
          return  httpContextAccessor!.HttpContext!.User?.Identity?.Name?;        
      }
  }  
  </code></pre>
  <p>Then what should I do to be able to delete
  <code>[Route(&quot;api/[controller]&quot;)]</code> and <code>[Route(&quot;GetUserName&quot;)]</code></p>
  <p>and still be able to use same route? <code>.../user/getusername</code>
  i want to be able to add new controllers / methods without having to specyfy any [Route(&quot;xxx&quot;)]. want it wo towk using default controller / action name for each own</p>
  <p>I thought that</p>
  <pre><code> app.UseEndpoints(endpoints =&gt;
       {
           endpoints.MapDefaultControllerRoute();
       });
  </code></pre>
  <p>will do it - but it is not... It does not change anything in that case...</p>
  <p>Thanks and regards!</p>