title: asp.net core - what are the differences of these MapRazorPages() calls?
body: <p><strong>Method 1</strong></p>
  <p>In ASP.NET Core 3.x, we add endpoints for Razor Pages with</p>
  <pre><code>app.UseEndpoints(endpoint =&gt;
  {
      endpoint.MapRazorPages();
  });
  </code></pre>
  <p><strong>Method 2</strong></p>
  <p>In the ASP.NET Core 6 Web App template (minimal hosting model), this has been changed to:</p>
  <pre><code>app.MapRazorPages();
  </code></pre>
  <p>From MS <a href="https://docs.microsoft.com/en-us/aspnet/core/mvc/controllers/routing?view=aspnetcore-6.0#conventional-routing" rel="nofollow noreferrer">docs page</a>:</p>
  <blockquote>
  <p>Apps typically don't need to call UseRouting or UseEndpoints. WebApplicationBuilder configures a middleware pipeline that wraps middleware added in Program.cs with UseRouting and UseEndpoints. For more information, see Routing in ASP.NET Core.</p>
  </blockquote>
  <p>My questions are:</p>
  <ol>
  <li>Do the 2 method calls above have the same effect?</li>
  <li>Am I correct to assume that the second way (i.e. <code>app.MapRazorPages()</code>) is possible due to the middleware pipeline configuration by <code>WebApplicationBuilder</code>? (see snippet from MS docs above).</li>
  </ol>
  <p>Thank you in advance.</p>