当前位置: 首页>>代码示例>>C#>>正文


C# IApplicationBuilder.UseCultureReplacer方法代码示例

本文整理汇总了C#中IApplicationBuilder.UseCultureReplacer方法的典型用法代码示例。如果您正苦于以下问题:C# IApplicationBuilder.UseCultureReplacer方法的具体用法?C# IApplicationBuilder.UseCultureReplacer怎么用?C# IApplicationBuilder.UseCultureReplacer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IApplicationBuilder的用法示例。


在下文中一共展示了IApplicationBuilder.UseCultureReplacer方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.UseCultureReplacer();

            app.UseInMemorySession();
            app.UseMvcWithDefaultRoute();
        }
开发者ID:RehanSaeed,项目名称:Mvc,代码行数:7,代码来源:Startup.cs

示例2: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.UseCultureReplacer();

            app.UseErrorPage();
            app.UseMvc();
        }
开发者ID:AndersBillLinden,项目名称:Mvc,代码行数:7,代码来源:Startup.cs

示例3: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.UseCultureReplacer();

            app.UseDeveloperExceptionPage();
            app.UseMvc();
        }
开发者ID:phinq19,项目名称:git_example,代码行数:7,代码来源:Startup.cs

示例4: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.UseCultureReplacer();

            app.UseErrorReporter();

            app.UseMvc(routes =>
            {
                routes.MapRoute("areaRoute",
                                "{area:exists}/{controller}/{action}",
                                new { controller = "Home", action = "Index" });

                routes.MapRoute("ActionAsMethod", "{controller}/{action}",
                    defaults: new { controller = "Home", action = "Index" });

                routes.MapRoute(
                    "products",
                    "api/Products/{country}/{action}",
                    defaults: new { controller = "Products" });

                // Added this route to validate that we throw an exception when a conventional
                // route matches a link generated by a named attribute route.
                // The conventional route will match first, but when the attribute route generates
                // a valid route an exception will be thrown.
                routes.MapRoute(
                    "DuplicateRoute",
                    "conventional/Duplicate",
                    defaults: new { controller = "Duplicate", action = "Duplicate" });

                routes.MapRoute(
                    "RouteWithOptionalSegment",
                    "{controller}/{action}/{path?}");
            });
        }
开发者ID:huoxudong125,项目名称:Mvc,代码行数:34,代码来源:Startup.cs

示例5: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.UseCultureReplacer();

            app.UseCors(policy => policy.WithOrigins("http://example.com"));
            app.UseMvc();
        }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:7,代码来源:Startup.cs

示例6: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.UseCultureReplacer();

            app.UseRequestLocalization();
            
            app.UseMvcWithDefaultRoute();
        }
开发者ID:ryanbrandenburg,项目名称:Mvc,代码行数:8,代码来源:Startup.cs

示例7: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.UseCultureReplacer();

            // Add MVC to the request pipeline
            app.UseMvc(routes =>
            {
                routes.MapRoute("ActionAsMethod", "{controller}/{action}",
                    defaults: new { controller = "Home", action = "Index" });
            });
        }
开发者ID:ymd1223,项目名称:Mvc,代码行数:11,代码来源:Startup.cs

示例8: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.UseCultureReplacer();

            app.UseErrorReporter();

            app.UseMvc(routes =>
            {
                routes.MapRoute("ActionAsMethod", "{controller}/{action}",
                    defaults: new { controller = "Home", action = "Index" });
            });
        }
开发者ID:notami18,项目名称:Mvc,代码行数:12,代码来源:Startup.cs

示例9: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.UseCultureReplacer();

            app.Use(async (HttpContext context, Func<Task> next) =>
            {
                if (!string.IsNullOrEmpty(context.Request.Headers["ENABLE-RAZOR-INSTRUMENTATION"]))
                {
                    var pageExecutionContext = context.ApplicationServices.GetRequiredService<TestPageExecutionContext>();
                    var listenerFeature = new TestPageExecutionListenerFeature(pageExecutionContext);
                    context.Features.Set<IPageExecutionListenerFeature>(listenerFeature);
                }

                await next();
            });

            // Add MVC to the request pipeline
            app.UseMvcWithDefaultRoute();
        }
开发者ID:4myBenefits,项目名称:Mvc,代码行数:19,代码来源:Startup.cs


注:本文中的IApplicationBuilder.UseCultureReplacer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。