title: .net core 3.1: Endpoint routing for razor pages AND API controllers
body: <p>**Edit - added query string</p>
  <p>I have upgraded a Core 2.2 site to 3.1, and the only issue still bugging me is the following:  I have regular Razor pages and API controllers in the same application - shared code and functionality make this an easy solution.  In 2.2, there wasn't an issue with the following routing setup:</p>
  <pre><code>services.AddMvc()
  </code></pre>
  <p>and</p>
  <pre><code> app.UseMvc(routes =&gt;
          {
              routes.MapRoute(
                  name: &quot;default&quot;,
                  template: &quot;{controller=Home}/{action=Index}/{id?}&quot;);
          });
  </code></pre>
  <p>in <code>Startup.ConfigureServices</code> and <code>Startup.Configure</code>, respectively.</p>
  <p>My controller looks like:</p>
  <pre><code>{
      [Route(&quot;api/[controller][&quot;)]
      [Produces(&quot;application/json&quot;)]
      [ApiController]
      public class RRateController : ControllerBase
      {
          public RRateController()
          {
          }
  
          [HttpGet]
          public async Task&lt;clsObject&gt; Get([FromQuery] string[] TopCodes)
          {
              clsObject obj = new clsObject();
              ...
              return obj;
          }
  }
  </code></pre>
  <p>The controller is called with the query string:</p>
  <pre><code>Root + '/API/RRate?TopCodes=Val1&amp;TopCodes=Val2'
  </code></pre>
  <p>Upgrading to .net core 3.1, I am using</p>
  <pre><code>    services.AddControllers();
      services.AddRazorPages();
  </code></pre>
  <p>and</p>
  <pre><code>    app.UseEndpoints(endpoints =&gt;
      {
          endpoints.MapRazorPages();
          endpoints.MapControllers();
      };
  </code></pre>
  <p>in <code>ConfigureServices</code> and <code>Configure</code>.</p>
  <p>My problem is that the string array for <code>TopCodes</code> is not passed into the controller.  The controller is accessed but the array is empty. A similar controller with no parameters works fine with the new setup.</p>
  <p>How should I configure endpoints to work both with Razor pages with the Controller\Action\parameter pattern, and for the API controllers?</p>