.NET Core:路由
(1)模板路由
在Startup的Configure方法中配置:
app.UseMvc(routes =>
{
routes.MapRoute(
name: "areas",
template: "api/{v:apiVersion}/{area:exists}/{controller=Home}/{action=Index}/{id?}"
);
});
(2)特性路由:
[Route("api/[area]/[controller]/[action]")]