Home > OS >  asp.net core - what are the differences of these MapRazorPages() calls?
asp.net core - what are the differences of these MapRazorPages() calls?

Time:07-21

Method 1

In ASP.NET Core 3.x, we add endpoints for Razor Pages with

app.UseEndpoints(endpoint =>
{
    endpoint.MapRazorPages();
});

Method 2

In the ASP.NET Core 6 Web App template (minimal hosting model), this has been changed to:

app.MapRazorPages();

From MS enter image description here

app.MapRazorPages();:

});

  • Related