RequestLocalizationMiddleware Class¶
Enables automatic setting of the culture for Microsoft.AspNetCore.Http.HttpRequests based on information
sent by the client in headers and logic provided by the application.
- Namespace
Microsoft.AspNetCore.Localization- Assemblies
- Microsoft.AspNetCore.Localization
Syntax¶
public class RequestLocalizationMiddleware
-
class
Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware
Constructors¶
-
RequestLocalizationMiddleware(Microsoft.AspNetCore.Http.RequestDelegate, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Builder.RequestLocalizationOptions>)¶ Creates a new
Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Arguments: - next (Microsoft.AspNetCore.Http.RequestDelegate) – The
Microsoft.AspNetCore.Http.RequestDelegaterepresenting the next middleware in the pipeline. - options (Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Builder.RequestLocalizationOptions>) – The
Microsoft.AspNetCore.Builder.RequestLocalizationOptionsrepresenting the options for theMicrosoft.AspNetCore.Localization.RequestLocalizationMiddleware.
public RequestLocalizationMiddleware(RequestDelegate next, IOptions<RequestLocalizationOptions> options)
- next (Microsoft.AspNetCore.Http.RequestDelegate) – The
-
Methods¶
-
Invoke(Microsoft.AspNetCore.Http.HttpContext)¶ Invokes the logic of the middleware.
Arguments: context (Microsoft.AspNetCore.Http.HttpContext) – The Microsoft.AspNetCore.Http.HttpContext.Return type: System.Threading.Tasks.Task Returns: A System.Threading.Tasks.Taskthat completes when the middleware has completed processing.public Task Invoke(HttpContext context)
-