本文整理汇总了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();
}
示例2: Configure
public void Configure(IApplicationBuilder app)
{
app.UseCultureReplacer();
app.UseErrorPage();
app.UseMvc();
}
示例3: Configure
public void Configure(IApplicationBuilder app)
{
app.UseCultureReplacer();
app.UseDeveloperExceptionPage();
app.UseMvc();
}
示例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?}");
});
}
示例5: Configure
public void Configure(IApplicationBuilder app)
{
app.UseCultureReplacer();
app.UseCors(policy => policy.WithOrigins("http://example.com"));
app.UseMvc();
}
示例6: Configure
public void Configure(IApplicationBuilder app)
{
app.UseCultureReplacer();
app.UseRequestLocalization();
app.UseMvcWithDefaultRoute();
}
示例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" });
});
}
示例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" });
});
}
示例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();
}