ApplicationBuilderExtensions.UseRequestLocalization 方法

定义

重载

UseRequestLocalization(IApplicationBuilder)

添加 以 RequestLocalizationMiddleware 根据客户端提供的信息自动设置请求的区域性信息。

UseRequestLocalization(IApplicationBuilder, RequestLocalizationOptions)

添加 以 RequestLocalizationMiddleware 根据客户端提供的信息自动设置请求的区域性信息。

UseRequestLocalization(IApplicationBuilder, Action<RequestLocalizationOptions>)

添加 以 RequestLocalizationMiddleware 根据客户端提供的信息自动设置请求的区域性信息。

UseRequestLocalization(IApplicationBuilder, String[])

添加 以 RequestLocalizationMiddleware 根据客户端提供的信息自动设置请求的区域性信息。

UseRequestLocalization(IApplicationBuilder)

Source:
ApplicationBuilderExtensions.cs
Source:
ApplicationBuilderExtensions.cs
Source:
ApplicationBuilderExtensions.cs

添加 以 RequestLocalizationMiddleware 根据客户端提供的信息自动设置请求的区域性信息。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseRequestLocalization(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseRequestLocalization (this Microsoft.AspNetCore.Builder.IApplicationBuilder app);
static member UseRequestLocalization : Microsoft.AspNetCore.Builder.IApplicationBuilder -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseRequestLocalization (app As IApplicationBuilder) As IApplicationBuilder

参数

返回

IApplicationBuilder

适用于

UseRequestLocalization(IApplicationBuilder, RequestLocalizationOptions)

Source:
ApplicationBuilderExtensions.cs
Source:
ApplicationBuilderExtensions.cs
Source:
ApplicationBuilderExtensions.cs

添加 以 RequestLocalizationMiddleware 根据客户端提供的信息自动设置请求的区域性信息。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseRequestLocalization(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Microsoft::AspNetCore::Builder::RequestLocalizationOptions ^ options);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseRequestLocalization (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Builder.RequestLocalizationOptions options);
static member UseRequestLocalization : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Builder.RequestLocalizationOptions -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseRequestLocalization (app As IApplicationBuilder, options As RequestLocalizationOptions) As IApplicationBuilder

参数

options
RequestLocalizationOptions

RequestLocalizationOptions用于配置中间件的 。

返回

IApplicationBuilder

适用于

UseRequestLocalization(IApplicationBuilder, Action<RequestLocalizationOptions>)

Source:
ApplicationBuilderExtensions.cs
Source:
ApplicationBuilderExtensions.cs
Source:
ApplicationBuilderExtensions.cs

添加 以 RequestLocalizationMiddleware 根据客户端提供的信息自动设置请求的区域性信息。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseRequestLocalization(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Action<Microsoft::AspNetCore::Builder::RequestLocalizationOptions ^> ^ optionsAction);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseRequestLocalization (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Action<Microsoft.AspNetCore.Builder.RequestLocalizationOptions> optionsAction);
static member UseRequestLocalization : Microsoft.AspNetCore.Builder.IApplicationBuilder * Action<Microsoft.AspNetCore.Builder.RequestLocalizationOptions> -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseRequestLocalization (app As IApplicationBuilder, optionsAction As Action(Of RequestLocalizationOptions)) As IApplicationBuilder

参数

optionsAction
Action<RequestLocalizationOptions>

配置 的 RequestLocalizationOptions回调。

返回

IApplicationBuilder

注解

这将实例化一个不来自服务的新 RequestLocalizationOptions

适用于

UseRequestLocalization(IApplicationBuilder, String[])

Source:
ApplicationBuilderExtensions.cs
Source:
ApplicationBuilderExtensions.cs
Source:
ApplicationBuilderExtensions.cs

添加 以 RequestLocalizationMiddleware 根据客户端提供的信息自动设置请求的区域性信息。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseRequestLocalization(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, ... cli::array <System::String ^> ^ cultures);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseRequestLocalization (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, params string[] cultures);
static member UseRequestLocalization : Microsoft.AspNetCore.Builder.IApplicationBuilder * string[] -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseRequestLocalization (app As IApplicationBuilder, ParamArray cultures As String()) As IApplicationBuilder

参数

cultures
String[]

应用程序要添加的区域性名称,表示支持的区域性和 UI 区域性。

返回

IApplicationBuilder

注解

请注意,第一个区域性是默认区域性名称。

适用于