title: How to define an endpoint route to multiple areas
body: <p>I am trying to define a <code>MapAreaControllerRoute()</code> that routes to multiple Areas. In ASP.NET Core 3.0, however, there is the <code>areaName:</code> parameter that needs to be set, thus restricting each route to a single area. I don't understand how I can use <em>one</em> route that will work for multiple Areas.</p>
  
  <p>I have read through many issues here on Stack Overflow, but it seems that this is a new requirement in ASP.NET Core 3.0. In ASP.NET Core &lt;= 2.2 you could create a <code>MapRoute()</code> without defining a set <code>areaName</code>.</p>
  
  <p>As it is now, in my <code>Startup.cs</code>, I define my endpoints as:</p>
  
  <pre><code>app.UseEndpoints(endpoints =&gt;
  {
    endpoints.MapAreaControllerRoute(
      name: "Area1",
      areaName: "Area1",
      pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}"
    );
  
    endpoints.MapAreaControllerRoute(
      name: "Area2",
      areaName: "Area2",
      pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}"
    );
  
    endpoints.MapControllerRoute(
      name: "default",
      pattern: "{controller=Home}/{action=Index}/{id?}");
  
  });
  </code></pre>
  
  <p>Surely, there must be a way to define a single route to cover all Areas?</p>