From 5dcb568df026e4d9fdc50450180a4e670590defa Mon Sep 17 00:00:00 2001 From: Dairai Nyabando Date: Fri, 22 Nov 2019 22:27:55 -0500 Subject: [PATCH] Updating descriptions to add parameters #17204 --- src/Http/Http.Abstractions/src/HttpMethods.cs | 9 ++++++ src/Http/Http/src/DefaultHttpContext.cs | 8 +++-- src/Http/Http/src/HttpContextAccessor.cs | 2 +- src/Http/Http/src/HttpContextFactory.cs | 31 +++++++++++++++++++ 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/src/Http/Http.Abstractions/src/HttpMethods.cs b/src/Http/Http.Abstractions/src/HttpMethods.cs index 6a3fc6aff3..9e4b94949a 100644 --- a/src/Http/Http.Abstractions/src/HttpMethods.cs +++ b/src/Http/Http.Abstractions/src/HttpMethods.cs @@ -31,6 +31,7 @@ namespace Microsoft.AspNetCore.Http /// /// Verifies the HTTP request method is CONNECT. /// + /// HTTP request method. public static bool IsConnect(string method) { return object.ReferenceEquals(Connect, method) || StringComparer.OrdinalIgnoreCase.Equals(Connect, method); @@ -39,6 +40,7 @@ namespace Microsoft.AspNetCore.Http /// /// Verifies the HTTP request method is DELETE. /// + /// HTTP request method. public static bool IsDelete(string method) { return object.ReferenceEquals(Delete, method) || StringComparer.OrdinalIgnoreCase.Equals(Delete, method); @@ -47,6 +49,7 @@ namespace Microsoft.AspNetCore.Http /// /// Verifies the HTTP request method is GET. /// + /// HTTP request method. public static bool IsGet(string method) { return object.ReferenceEquals(Get, method) || StringComparer.OrdinalIgnoreCase.Equals(Get, method); @@ -55,6 +58,7 @@ namespace Microsoft.AspNetCore.Http /// /// Verifies the HTTP request method is HEAD. /// + /// HTTP request method. public static bool IsHead(string method) { return object.ReferenceEquals(Head, method) || StringComparer.OrdinalIgnoreCase.Equals(Head, method); @@ -63,6 +67,7 @@ namespace Microsoft.AspNetCore.Http /// /// Verifies the HTTP request method is OPTIONS. /// + /// HTTP request method. public static bool IsOptions(string method) { return object.ReferenceEquals(Options, method) || StringComparer.OrdinalIgnoreCase.Equals(Options, method); @@ -71,6 +76,7 @@ namespace Microsoft.AspNetCore.Http /// /// Verifies the HTTP request method is PATCH. /// + /// HTTP request method. public static bool IsPatch(string method) { return object.ReferenceEquals(Patch, method) || StringComparer.OrdinalIgnoreCase.Equals(Patch, method); @@ -79,6 +85,7 @@ namespace Microsoft.AspNetCore.Http /// /// Verifies the HTTP request method is POST. /// + /// HTTP request method. public static bool IsPost(string method) { return object.ReferenceEquals(Post, method) || StringComparer.OrdinalIgnoreCase.Equals(Post, method); @@ -87,6 +94,7 @@ namespace Microsoft.AspNetCore.Http /// /// Verifies the HTTP request method is PUT. /// + /// HTTP request method. public static bool IsPut(string method) { return object.ReferenceEquals(Put, method) || StringComparer.OrdinalIgnoreCase.Equals(Put, method); @@ -95,6 +103,7 @@ namespace Microsoft.AspNetCore.Http /// /// Verifies the HTTP request method is TRACE. /// + /// HTTP request method. public static bool IsTrace(string method) { return object.ReferenceEquals(Trace, method) || StringComparer.OrdinalIgnoreCase.Equals(Trace, method); diff --git a/src/Http/Http/src/DefaultHttpContext.cs b/src/Http/Http/src/DefaultHttpContext.cs index 73f932746e..70c1b0d29c 100644 --- a/src/Http/Http/src/DefaultHttpContext.cs +++ b/src/Http/Http/src/DefaultHttpContext.cs @@ -14,7 +14,7 @@ using Microsoft.Extensions.DependencyInjection; namespace Microsoft.AspNetCore.Http { /// - /// Represents an implementation of the HTTP Context class with HTTP-specific information for a request. + /// Represents an implementation of the HTTP Context class. /// public sealed class DefaultHttpContext : HttpContext { @@ -47,8 +47,9 @@ namespace Microsoft.AspNetCore.Http } /// - /// Initializes a new instance of the DefaultHttpContext class with the using a collection of AspNetCore.Http.Features. + /// Initializes a new instance of the DefaultHttpContext class with options passed in. /// + /// Options to set when instantianting the Default HTTP context object. public DefaultHttpContext(IFeatureCollection features) { _features.Initalize(features); @@ -57,8 +58,9 @@ namespace Microsoft.AspNetCore.Http } /// - /// Initialize the current instant of the class with the using a collection of AspNetCore.Http.Features. + /// Initialize the current instant of the class with options passed in. /// + /// Options to initialize the Default HTTP context object. public void Initialize(IFeatureCollection features) { var revision = features.Revision; diff --git a/src/Http/Http/src/HttpContextAccessor.cs b/src/Http/Http/src/HttpContextAccessor.cs index d99e02ef88..e910dcdfbb 100644 --- a/src/Http/Http/src/HttpContextAccessor.cs +++ b/src/Http/Http/src/HttpContextAccessor.cs @@ -6,7 +6,7 @@ using System.Threading; namespace Microsoft.AspNetCore.Http { /// - /// Represents the properties and methods used to keep access the current HTTP context. + /// Represents the properties and methods used to access the current HTTP context. /// public class HttpContextAccessor : IHttpContextAccessor { diff --git a/src/Http/Http/src/HttpContextFactory.cs b/src/Http/Http/src/HttpContextFactory.cs index 3121c1704b..10688b0572 100644 --- a/src/Http/Http/src/HttpContextFactory.cs +++ b/src/Http/Http/src/HttpContextFactory.cs @@ -8,6 +8,9 @@ using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.Http { + /// + /// Represents methods used to create an HTTP context object. + /// [Obsolete("This is obsolete and will be removed in a future version. Use DefaultHttpContextFactory instead.")] public class HttpContextFactory : IHttpContextFactory { @@ -15,21 +18,41 @@ namespace Microsoft.AspNetCore.Http private readonly FormOptions _formOptions; private readonly IServiceScopeFactory _serviceScopeFactory; + /// + /// Initializes a new instance of the HttpContext class with options passed in. + /// + /// Options to set when instantianting the HTTP context object. public HttpContextFactory(IOptions formOptions) : this(formOptions, serviceScopeFactory: null) { } + /// + /// Initializes a new instance of the DefaultHttpContext class with options passed in. + /// + /// Options to set when instantianting the HTTP context object. + /// Factory object used to create the service scope for the HTTP context. public HttpContextFactory(IOptions formOptions, IServiceScopeFactory serviceScopeFactory) : this(formOptions, serviceScopeFactory, httpContextAccessor: null) { } + /// + /// Initializes a new instance of the DefaultHttpContext class with options passed in. + /// + /// Options to set when instantianting the HTTP context object. + /// Object to be used to access the HTTP context instance. public HttpContextFactory(IOptions formOptions, IHttpContextAccessor httpContextAccessor) : this(formOptions, serviceScopeFactory: null, httpContextAccessor: httpContextAccessor) { } + /// + /// Initializes a new instance of the DefaultHttpContext class with options passed in. + /// + /// Options to set when instantianting the HTTP context object. + /// Factory object used to create the service scope for the HTTP context. + /// Options to set when instantianting the Default HTTP context object. public HttpContextFactory(IOptions formOptions, IServiceScopeFactory serviceScopeFactory, IHttpContextAccessor httpContextAccessor) { if (formOptions == null) @@ -47,6 +70,10 @@ namespace Microsoft.AspNetCore.Http _httpContextAccessor = httpContextAccessor; } + /// + /// Initializes a new instance of the DefaultHttpContext class with options passed in. + /// + /// Options to set when instantianting the Default HTTP context object. public HttpContext Create(IFeatureCollection featureCollection) { if (featureCollection == null) @@ -66,6 +93,10 @@ namespace Microsoft.AspNetCore.Http return httpContext; } + /// + /// Sets the HTTP context object to null for garbage collection. + /// + /// HTTP context to dispose. public void Dispose(HttpContext httpContext) { if (_httpContextAccessor != null)