Asp.net core 学习笔记 ( Router 路由 )

和之前的一样用法. 

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{ 
    app.UseMvc(routes =>
    { 
        routes.MapRoute(
            name: "client-side",
            template: "{action=Index}/{Id:int?}",
            defaults: new { controller = "Home" }
// constraints: new { id = new IntRouteConstraint() } ); }); }
posted @ 2017-09-11 19:15  兴杰  阅读(569)  评论(0编辑  收藏  举报