net core 3.1 area

  app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                 name: "default",
                 pattern: "{controller=Home}/{action=Index}/{id?}");

                endpoints.MapControllerRoute(
                  name: "Area",
                  pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
            });
        }

Areas-products-Controllers-HomeController.Controllers
Areas-products-Views-Home-Index.cshtml

    [Area("Products")]
    public class HomeController : Controller

 

posted on 2020-07-08 16:12  Aaron_Net  阅读(264)  评论(0编辑  收藏  举报