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:
Steve Sanderson 2020-10-14 22:02:24 +01:00 committed by GitHub
parent a0ab0964d4
commit 86705673c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 25 additions and 24 deletions

View File

@ -5,7 +5,7 @@
<Description>Provides a request culture provider which gets culture and ui-culture from request's route data.</Description> <Description>Provides a request culture provider which gets culture and ui-culture from request's route data.</Description>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<IsAspNetCoreApp>true</IsAspNetCoreApp> <IsAspNetCoreApp>true</IsAspNetCoreApp>
<NoWarn>$(NoWarn);CS1591</NoWarn> <NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;localization</PackageTags> <PackageTags>aspnetcore;localization</PackageTags>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>

View File

@ -1,5 +1,5 @@
// Copyright (c) .NET Foundation. All rights reserved. // 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using Microsoft.AspNetCore.Localization; using Microsoft.AspNetCore.Localization;
@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Builder
{ {
throw new ArgumentNullException(nameof(app)); throw new ArgumentNullException(nameof(app));
} }
if (options == null) if (options == null)
{ {
throw new ArgumentNullException(nameof(options)); throw new ArgumentNullException(nameof(options));
@ -54,10 +54,10 @@ namespace Microsoft.AspNetCore.Builder
/// <summary> /// <summary>
/// Adds the <see cref="RequestLocalizationMiddleware"/> to automatically set culture information for /// 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> /// </summary>
/// <param name="app">The <see cref="IApplicationBuilder"/>.</param> /// <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> /// <remarks>
/// This will going to instantiate a new <see cref="RequestLocalizationOptions"/> that doesn't come from the services. /// This will going to instantiate a new <see cref="RequestLocalizationOptions"/> that doesn't come from the services.
/// </remarks> /// </remarks>
@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.Builder
/// <summary> /// <summary>
/// Adds the <see cref="RequestLocalizationMiddleware"/> to automatically set culture information for /// 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> /// </summary>
/// <param name="app">The <see cref="IApplicationBuilder"/>.</param> /// <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> /// <param name="cultures">The culture names to be added by the application, which is represents both supported cultures and UI cultures.</param>

View File

@ -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> <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> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<IsAspNetCoreApp>true</IsAspNetCoreApp> <IsAspNetCoreApp>true</IsAspNetCoreApp>
<NoWarn>$(NoWarn);CS1591</NoWarn> <NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;localization</PackageTags> <PackageTags>aspnetcore;localization</PackageTags>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>

View File

@ -16,7 +16,7 @@ namespace Microsoft.Extensions.DependencyInjection
/// </summary> /// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> for adding services.</param> /// <param name="services">The <see cref="IServiceCollection"/> for adding services.</param>
/// <param name="configureOptions">A delegate to configure the <see cref="RequestLocalizationOptions"/>.</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) public static IServiceCollection AddRequestLocalization(this IServiceCollection services, Action<RequestLocalizationOptions> configureOptions)
{ {
if (services == null) if (services == null)
@ -36,7 +36,7 @@ namespace Microsoft.Extensions.DependencyInjection
/// </summary> /// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> for adding services.</param> /// <param name="services">The <see cref="IServiceCollection"/> for adding services.</param>
/// <param name="configureOptions">A delegate to configure the <see cref="RequestLocalizationOptions"/>.</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 public static IServiceCollection AddRequestLocalization<TService>(this IServiceCollection services, Action<RequestLocalizationOptions, TService> configureOptions) where TService : class
{ {
if (services == null) if (services == null)

View File

@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.ResponseCompression
/// <summary> /// <summary>
/// Creates a new instance of <see cref="BrotliCompressionProvider"/> with options. /// Creates a new instance of <see cref="BrotliCompressionProvider"/> with options.
/// </summary> /// </summary>
/// <param name="options"></param> /// <param name="options">The options for this instance.</param>
public BrotliCompressionProvider(IOptions<BrotliCompressionProviderOptions> options) public BrotliCompressionProvider(IOptions<BrotliCompressionProviderOptions> options)
{ {
if (options == null) if (options == null)

View File

@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.ResponseCompression
/// <summary> /// <summary>
/// Creates a new instance of GzipCompressionProvider with options. /// Creates a new instance of GzipCompressionProvider with options.
/// </summary> /// </summary>
/// <param name="options"></param> /// <param name="options">The options for this instance.</param>
public GzipCompressionProvider(IOptions<GzipCompressionProviderOptions> options) public GzipCompressionProvider(IOptions<GzipCompressionProviderOptions> options)
{ {
if (options == null) if (options == null)

View File

@ -13,22 +13,22 @@ namespace Microsoft.AspNetCore.ResponseCompression
/// <summary> /// <summary>
/// Examines the request and selects an acceptable compression provider, if any. /// Examines the request and selects an acceptable compression provider, if any.
/// </summary> /// </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> /// <returns>A compression provider or null if compression should not be used.</returns>
ICompressionProvider GetCompressionProvider(HttpContext context); ICompressionProvider GetCompressionProvider(HttpContext context);
/// <summary> /// <summary>
/// Examines the response on first write to see if compression should be used. /// Examines the response on first write to see if compression should be used.
/// </summary> /// </summary>
/// <param name="context"></param> /// <param name="context">The <see cref="HttpContext"/>.</param>
/// <returns></returns> /// <returns><see langword="true" /> if the response should be compressed, otherwise <see langword="false" />.</returns>
bool ShouldCompressResponse(HttpContext context); bool ShouldCompressResponse(HttpContext context);
/// <summary> /// <summary>
/// Examines the request to see if compression should be used for response. /// Examines the request to see if compression should be used for response.
/// </summary> /// </summary>
/// <param name="context"></param> /// <param name="context">The <see cref="HttpContext"/>.</param>
/// <returns></returns> /// <returns><see langword="true" /> if the request accepts compression, otherwise <see langword="false" />.</returns>
bool CheckRequestAcceptsCompression(HttpContext context); bool CheckRequestAcceptsCompression(HttpContext context);
} }
} }

View File

@ -4,6 +4,7 @@
<Description>ASP.NET Core middleware for HTTP Response compression.</Description> <Description>ASP.NET Core middleware for HTTP Response compression.</Description>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<IsAspNetCoreApp>true</IsAspNetCoreApp> <IsAspNetCoreApp>true</IsAspNetCoreApp>
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore</PackageTags> <PackageTags>aspnetcore</PackageTags>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>

View File

@ -21,8 +21,8 @@ namespace Microsoft.AspNetCore.ResponseCompression
/// <summary> /// <summary>
/// Initialize the Response Compression middleware. /// Initialize the Response Compression middleware.
/// </summary> /// </summary>
/// <param name="next"></param> /// <param name="next">The delegate representing the remaining middleware in the request pipeline.</param>
/// <param name="provider"></param> /// <param name="provider">The <see cref="IResponseCompressionProvider"/>.</param>
public ResponseCompressionMiddleware(RequestDelegate next, IResponseCompressionProvider provider) public ResponseCompressionMiddleware(RequestDelegate next, IResponseCompressionProvider provider)
{ {
if (next == null) if (next == null)
@ -41,8 +41,8 @@ namespace Microsoft.AspNetCore.ResponseCompression
/// <summary> /// <summary>
/// Invoke the middleware. /// Invoke the middleware.
/// </summary> /// </summary>
/// <param name="context"></param> /// <param name="context">The <see cref="HttpContext"/>.</param>
/// <returns></returns> /// <returns>A task that represents the execution of this middleware.</returns>
public async Task Invoke(HttpContext context) public async Task Invoke(HttpContext context)
{ {
if (!_provider.CheckRequestAcceptsCompression(context)) if (!_provider.CheckRequestAcceptsCompression(context))

View File

@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore.ResponseCompression
/// If no compression providers are specified then GZip is used by default. /// If no compression providers are specified then GZip is used by default.
/// </summary> /// </summary>
/// <param name="services">Services to use when instantiating compression providers.</param> /// <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) public ResponseCompressionProvider(IServiceProvider services, IOptions<ResponseCompressionOptions> options)
{ {
if (services == null) if (services == null)

View File

@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Builder
/// Add response compression services. /// Add response compression services.
/// </summary> /// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> for adding services.</param> /// <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) public static IServiceCollection AddResponseCompression(this IServiceCollection services)
{ {
if (services == null) if (services == null)
@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.Builder
/// </summary> /// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> for adding services.</param> /// <param name="services">The <see cref="IServiceCollection"/> for adding services.</param>
/// <param name="configureOptions">A delegate to configure the <see cref="ResponseCompressionOptions"/>.</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) public static IServiceCollection AddResponseCompression(this IServiceCollection services, Action<ResponseCompressionOptions> configureOptions)
{ {
if (services == null) if (services == null)