📜  AddAreaFolderRouteModelConvention - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:49.735000             🧑  作者: Mango

代码示例1
services.AddMvc()
    .AddRazorPagesOptions(options =>
    {
        options.Conventions.AddAreaFolderRouteModelConvention("Identity", "/Account/", model =>
         {
             model.Selectors.ForEach(x =>
             {
                 if (x.AttributeRouteModel.Template.StartsWith("Identity"))
                 {
                     x.AttributeRouteModel = new AttributeRouteModel()
                     {
                         Order = -1,
                         Template = AttributeRouteModel.CombineTemplates(("{culture=en-US}"),
                             x.AttributeRouteModel.Template)
                     };
                 }
             });


         });
    });