Skip to content

Pact Localization ServiceCollectionExtensions UseDynamicRequestLocalization(Microsoft AspNetCore Builder IApplicationBuilder System Action Microsoft AspNetCore Builder RequestLocalizationOptions )

welshronaldo edited this page May 30, 2022 · 6 revisions

ServiceCollectionExtensions.UseDynamicRequestLocalization(IApplicationBuilder, Action<RequestLocalizationOptions>) Method

Adds the DynamicLocalizationMiddleware to automatically set culture information for
requests based on information provided by the client.
NOTE: probably want this placed towards the bottom of the middleware stack to ensure the HttpContext is furnished with an Identity by the time it arrives

public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseDynamicRequestLocalization(this Microsoft.AspNetCore.Builder.IApplicationBuilder app, System.Action<Microsoft.AspNetCore.Builder.RequestLocalizationOptions> optionsAction);

Parameters

app Microsoft.AspNetCore.Builder.IApplicationBuilder
The Microsoft.AspNetCore.Builder.IApplicationBuilder.

optionsAction System.Action<Microsoft.AspNetCore.Builder.RequestLocalizationOptions>

Returns

Microsoft.AspNetCore.Builder.IApplicationBuilder
The Microsoft.AspNetCore.Builder.IApplicationBuilder.

Remarks

This will going to instantiate a new Microsoft.AspNetCore.Builder.RequestLocalizationOptions that doesn't come from the services.

Clone this wiki locally