How do I use an Area in ASP.NET Core?
I have an app that needs an Admin section. This section requires its Views to be placed in that area. All request
In the Microsoft docs to migrate from ASP.NET CORE 2.2 to 3.0 the suggestion is to:
Replace UseMvc with UseEndpoints.
I encountered some challenges while trying to fix my Area's while simultaneously having Identity to keep working - but the solution below seems to be working for ASP.NET CORE 3.0 :
app.UseEndpoints(endpoints =>
{
endpoints.MapRazorPages();
endpoints.MapControllerRoute("areas", "{area:exists}/{controller=Home}/{action=Index}/{id?}");
endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
});
Hopefully I could also help you out and reduce the research time :-)