XML docs for Middleware: Localization, Localization.Routing, ResponseCompression (#26889)
* XML docs for Middleware/Localization and Localization.Routing * XML docs for Middleware/ResponseCompression
This commit is contained in:
parent
a0ab0964d4
commit
86705673c7
|
|
@ -5,7 +5,7 @@
|
|||
<Description>Provides a request culture provider which gets culture and ui-culture from request's route data.</Description>
|
||||
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
|
||||
<IsAspNetCoreApp>true</IsAspNetCoreApp>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>aspnetcore;localization</PackageTags>
|
||||
<IsPackable>false</IsPackable>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
|
|
@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Builder
|
|||
{
|
||||
throw new ArgumentNullException(nameof(app));
|
||||
}
|
||||
|
||||
|
||||
if (options == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(options));
|
||||
|
|
@ -54,10 +54,10 @@ namespace Microsoft.AspNetCore.Builder
|
|||
|
||||
/// <summary>
|
||||
/// Adds the <see cref="RequestLocalizationMiddleware"/> to automatically set culture information for
|
||||
/// requests based on information provided by the client.
|
||||
/// requests based on information provided by the client.
|
||||
/// </summary>
|
||||
/// <param name="app">The <see cref="IApplicationBuilder"/>.</param>
|
||||
/// <param name="optionsAction"></param>
|
||||
/// <param name="optionsAction">A callback that configures the <see cref="RequestLocalizationOptions"/>.</param>
|
||||
/// <remarks>
|
||||
/// This will going to instantiate a new <see cref="RequestLocalizationOptions"/> that doesn't come from the services.
|
||||
/// </remarks>
|
||||
|
|
@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.Builder
|
|||
|
||||
/// <summary>
|
||||
/// Adds the <see cref="RequestLocalizationMiddleware"/> to automatically set culture information for
|
||||
/// requests based on information provided by the client.
|
||||
/// requests based on information provided by the client.
|
||||
/// </summary>
|
||||
/// <param name="app">The <see cref="IApplicationBuilder"/>.</param>
|
||||
/// <param name="cultures">The culture names to be added by the application, which is represents both supported cultures and UI cultures.</param>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<Description>ASP.NET Core middleware for automatically applying culture information to HTTP requests. Culture information can be specified in the HTTP header, query string, cookie, or custom source.</Description>
|
||||
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
|
||||
<IsAspNetCoreApp>true</IsAspNetCoreApp>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>aspnetcore;localization</PackageTags>
|
||||
<IsPackable>false</IsPackable>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
/// </summary>
|
||||
/// <param name="services">The <see cref="IServiceCollection"/> for adding services.</param>
|
||||
/// <param name="configureOptions">A delegate to configure the <see cref="RequestLocalizationOptions"/>.</param>
|
||||
/// <returns></returns>
|
||||
/// <returns>The <see cref="IServiceCollection"/>.</returns>
|
||||
public static IServiceCollection AddRequestLocalization(this IServiceCollection services, Action<RequestLocalizationOptions> configureOptions)
|
||||
{
|
||||
if (services == null)
|
||||
|
|
@ -36,7 +36,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
/// </summary>
|
||||
/// <param name="services">The <see cref="IServiceCollection"/> for adding services.</param>
|
||||
/// <param name="configureOptions">A delegate to configure the <see cref="RequestLocalizationOptions"/>.</param>
|
||||
/// <returns></returns>
|
||||
/// <returns>The <see cref="IServiceCollection"/>.</returns>
|
||||
public static IServiceCollection AddRequestLocalization<TService>(this IServiceCollection services, Action<RequestLocalizationOptions, TService> configureOptions) where TService : class
|
||||
{
|
||||
if (services == null)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.ResponseCompression
|
|||
/// <summary>
|
||||
/// Creates a new instance of <see cref="BrotliCompressionProvider"/> with options.
|
||||
/// </summary>
|
||||
/// <param name="options"></param>
|
||||
/// <param name="options">The options for this instance.</param>
|
||||
public BrotliCompressionProvider(IOptions<BrotliCompressionProviderOptions> options)
|
||||
{
|
||||
if (options == null)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.ResponseCompression
|
|||
/// <summary>
|
||||
/// Creates a new instance of GzipCompressionProvider with options.
|
||||
/// </summary>
|
||||
/// <param name="options"></param>
|
||||
/// <param name="options">The options for this instance.</param>
|
||||
public GzipCompressionProvider(IOptions<GzipCompressionProviderOptions> options)
|
||||
{
|
||||
if (options == null)
|
||||
|
|
|
|||
|
|
@ -13,22 +13,22 @@ namespace Microsoft.AspNetCore.ResponseCompression
|
|||
/// <summary>
|
||||
/// Examines the request and selects an acceptable compression provider, if any.
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <param name="context">The <see cref="HttpContext"/>.</param>
|
||||
/// <returns>A compression provider or null if compression should not be used.</returns>
|
||||
ICompressionProvider GetCompressionProvider(HttpContext context);
|
||||
|
||||
/// <summary>
|
||||
/// Examines the response on first write to see if compression should be used.
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <returns></returns>
|
||||
/// <param name="context">The <see cref="HttpContext"/>.</param>
|
||||
/// <returns><see langword="true" /> if the response should be compressed, otherwise <see langword="false" />.</returns>
|
||||
bool ShouldCompressResponse(HttpContext context);
|
||||
|
||||
/// <summary>
|
||||
/// Examines the request to see if compression should be used for response.
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <returns></returns>
|
||||
/// <param name="context">The <see cref="HttpContext"/>.</param>
|
||||
/// <returns><see langword="true" /> if the request accepts compression, otherwise <see langword="false" />.</returns>
|
||||
bool CheckRequestAcceptsCompression(HttpContext context);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
<Description>ASP.NET Core middleware for HTTP Response compression.</Description>
|
||||
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
|
||||
<IsAspNetCoreApp>true</IsAspNetCoreApp>
|
||||
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>aspnetcore</PackageTags>
|
||||
<IsPackable>false</IsPackable>
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ namespace Microsoft.AspNetCore.ResponseCompression
|
|||
/// <summary>
|
||||
/// Initialize the Response Compression middleware.
|
||||
/// </summary>
|
||||
/// <param name="next"></param>
|
||||
/// <param name="provider"></param>
|
||||
/// <param name="next">The delegate representing the remaining middleware in the request pipeline.</param>
|
||||
/// <param name="provider">The <see cref="IResponseCompressionProvider"/>.</param>
|
||||
public ResponseCompressionMiddleware(RequestDelegate next, IResponseCompressionProvider provider)
|
||||
{
|
||||
if (next == null)
|
||||
|
|
@ -41,8 +41,8 @@ namespace Microsoft.AspNetCore.ResponseCompression
|
|||
/// <summary>
|
||||
/// Invoke the middleware.
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <returns></returns>
|
||||
/// <param name="context">The <see cref="HttpContext"/>.</param>
|
||||
/// <returns>A task that represents the execution of this middleware.</returns>
|
||||
public async Task Invoke(HttpContext context)
|
||||
{
|
||||
if (!_provider.CheckRequestAcceptsCompression(context))
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore.ResponseCompression
|
|||
/// If no compression providers are specified then GZip is used by default.
|
||||
/// </summary>
|
||||
/// <param name="services">Services to use when instantiating compression providers.</param>
|
||||
/// <param name="options"></param>
|
||||
/// <param name="options">The options for this instance.</param>
|
||||
public ResponseCompressionProvider(IServiceProvider services, IOptions<ResponseCompressionOptions> options)
|
||||
{
|
||||
if (services == null)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Builder
|
|||
/// Add response compression services.
|
||||
/// </summary>
|
||||
/// <param name="services">The <see cref="IServiceCollection"/> for adding services.</param>
|
||||
/// <returns></returns>
|
||||
/// <returns>The <see cref="IServiceCollection"/>.</returns>
|
||||
public static IServiceCollection AddResponseCompression(this IServiceCollection services)
|
||||
{
|
||||
if (services == null)
|
||||
|
|
@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.Builder
|
|||
/// </summary>
|
||||
/// <param name="services">The <see cref="IServiceCollection"/> for adding services.</param>
|
||||
/// <param name="configureOptions">A delegate to configure the <see cref="ResponseCompressionOptions"/>.</param>
|
||||
/// <returns></returns>
|
||||
/// <returns>The <see cref="IServiceCollection"/>.</returns>
|
||||
public static IServiceCollection AddResponseCompression(this IServiceCollection services, Action<ResponseCompressionOptions> configureOptions)
|
||||
{
|
||||
if (services == null)
|
||||
|
|
|
|||
Loading…
Reference in New Issue