Adding back middleware initialization with options instance.
This commit is contained in:
parent
d9fc399531
commit
c1589ef9bc
|
|
@ -37,5 +37,28 @@ namespace Microsoft.AspNet.Builder
|
||||||
|
|
||||||
return app.UseMiddleware<RequestLocalizationMiddleware>(options);
|
return app.UseMiddleware<RequestLocalizationMiddleware>(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds the <see cref="RequestLocalizationMiddleware"/> to automatically set culture information for
|
||||||
|
/// requests based on information provided by the client.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="app">The <see cref="IApplicationBuilder"/>.</param>
|
||||||
|
/// <param name="options">The <see cref="RequestLocalizationOptions"/> to configure the middleware with.</param>
|
||||||
|
/// <returns>The <see cref="IApplicationBuilder"/>.</returns>
|
||||||
|
public static IApplicationBuilder UseRequestLocalization(
|
||||||
|
this IApplicationBuilder app,
|
||||||
|
RequestLocalizationOptions options)
|
||||||
|
{
|
||||||
|
if (app == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(app));
|
||||||
|
}
|
||||||
|
if (options == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(options));
|
||||||
|
}
|
||||||
|
|
||||||
|
return app.UseMiddleware<RequestLocalizationMiddleware>(options);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue