Skip to content

XML docs for Middleware: Localization, Localization.Routing, ResponseCompression #26889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -43,7 +43,7 @@ public static IApplicationBuilder UseRequestLocalization(
{
throw new ArgumentNullException(nameof(app));
}

if (options == null)
{
throw new ArgumentNullException(nameof(options));
Expand All @@ -54,10 +54,10 @@ public static IApplicationBuilder UseRequestLocalization(

/// <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>
Expand All @@ -84,7 +84,7 @@ public static IApplicationBuilder UseRequestLocalization(

/// <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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static class RequestLocalizationServiceCollectionExtensions
/// </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)
Expand All @@ -36,7 +36,7 @@ public static IServiceCollection AddRequestLocalization(this IServiceCollection
/// </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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class BrotliCompressionProvider : ICompressionProvider
/// <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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class GzipCompressionProvider : ICompressionProvider
/// <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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ public interface IResponseCompressionProvider
/// <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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public class ResponseCompressionMiddleware
/// <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)
Expand All @@ -41,8 +41,8 @@ public ResponseCompressionMiddleware(RequestDelegate next, IResponseCompressionP
/// <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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class ResponseCompressionProvider : IResponseCompressionProvider
/// 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class ResponseCompressionServicesExtensions
/// 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)
Expand All @@ -34,7 +34,7 @@ public static IServiceCollection AddResponseCompression(this IServiceCollection
/// </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)
Expand Down