Additional class and methods description changes including adding class references and inheriting docs

#17349
This commit is contained in:
Dairai Nyabando 2019-11-23 18:27:12 -05:00
parent aeb8ab554a
commit 7c8d0f89f8
4 changed files with 70 additions and 69 deletions

View File

@ -31,7 +31,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Returns a value that indicates if the HTTP request method is CONNECT. /// Returns a value that indicates if the HTTP request method is CONNECT.
/// <summary/> /// <summary/>
/// <param name="method">HTTP request method.</param> /// <param name="method">The HTTP request method.</param>
/// <returns>
/// The System.Boolean.
/// </returns>
public static bool IsConnect(string method) public static bool IsConnect(string method)
{ {
return object.ReferenceEquals(Connect, method) || StringComparer.OrdinalIgnoreCase.Equals(Connect, method); return object.ReferenceEquals(Connect, method) || StringComparer.OrdinalIgnoreCase.Equals(Connect, method);
@ -40,7 +43,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Returns a value that indicates if the HTTP request method is DELETE. /// Returns a value that indicates if the HTTP request method is DELETE.
/// <summary/> /// <summary/>
/// <param name="method">HTTP request method.</param> /// <param name="method">The HTTP request method.</param>
/// <returns>
/// The System.Boolean.
/// </returns>
public static bool IsDelete(string method) public static bool IsDelete(string method)
{ {
return object.ReferenceEquals(Delete, method) || StringComparer.OrdinalIgnoreCase.Equals(Delete, method); return object.ReferenceEquals(Delete, method) || StringComparer.OrdinalIgnoreCase.Equals(Delete, method);
@ -49,7 +55,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Returns a value that indicates if the HTTP request method is GET. /// Returns a value that indicates if the HTTP request method is GET.
/// <summary/> /// <summary/>
/// <param name="method">HTTP request method.</param> /// <param name="method">The HTTP request method.</param>
/// <returns>
/// The System.Boolean.
/// </returns>
public static bool IsGet(string method) public static bool IsGet(string method)
{ {
return object.ReferenceEquals(Get, method) || StringComparer.OrdinalIgnoreCase.Equals(Get, method); return object.ReferenceEquals(Get, method) || StringComparer.OrdinalIgnoreCase.Equals(Get, method);
@ -58,7 +67,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Returns a value that indicates if the HTTP request method is HEAD. /// Returns a value that indicates if the HTTP request method is HEAD.
/// <summary/> /// <summary/>
/// <param name="method">HTTP request method.</param> /// <param name="method">The HTTP request method.</param>
/// <returns>
/// The System.Boolean.
/// </returns>
public static bool IsHead(string method) public static bool IsHead(string method)
{ {
return object.ReferenceEquals(Head, method) || StringComparer.OrdinalIgnoreCase.Equals(Head, method); return object.ReferenceEquals(Head, method) || StringComparer.OrdinalIgnoreCase.Equals(Head, method);
@ -67,7 +79,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Returns a value that indicates if the HTTP request method is OPTIONS. /// Returns a value that indicates if the HTTP request method is OPTIONS.
/// <summary/> /// <summary/>
/// <param name="method">HTTP request method.</param> /// <param name="method">The HTTP request method.</param>
/// <returns>
/// The System.Boolean.
/// </returns>
public static bool IsOptions(string method) public static bool IsOptions(string method)
{ {
return object.ReferenceEquals(Options, method) || StringComparer.OrdinalIgnoreCase.Equals(Options, method); return object.ReferenceEquals(Options, method) || StringComparer.OrdinalIgnoreCase.Equals(Options, method);
@ -76,7 +91,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Returns a value that indicates if the HTTP request method is PATCH. /// Returns a value that indicates if the HTTP request method is PATCH.
/// <summary/> /// <summary/>
/// <param name="method">HTTP request method.</param> /// <param name="method">The HTTP request method.</param>
/// <returns>
/// The System.Boolean.
/// </returns>
public static bool IsPatch(string method) public static bool IsPatch(string method)
{ {
return object.ReferenceEquals(Patch, method) || StringComparer.OrdinalIgnoreCase.Equals(Patch, method); return object.ReferenceEquals(Patch, method) || StringComparer.OrdinalIgnoreCase.Equals(Patch, method);
@ -85,7 +103,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Returns a value that indicates if the HTTP request method is POST. /// Returns a value that indicates if the HTTP request method is POST.
/// <summary/> /// <summary/>
/// <param name="method">HTTP request method.</param> /// <param name="method">The HTTP request method.</param>
/// <returns>
/// The System.Boolean.
/// </returns>
public static bool IsPost(string method) public static bool IsPost(string method)
{ {
return object.ReferenceEquals(Post, method) || StringComparer.OrdinalIgnoreCase.Equals(Post, method); return object.ReferenceEquals(Post, method) || StringComparer.OrdinalIgnoreCase.Equals(Post, method);
@ -94,7 +115,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Returns a value that indicates if the HTTP request method is PUT. /// Returns a value that indicates if the HTTP request method is PUT.
/// <summary/> /// <summary/>
/// <param name="method">HTTP request method.</param> /// <param name="method">The HTTP request method.</param>
/// <returns>
/// The System.Boolean.
/// </returns>
public static bool IsPut(string method) public static bool IsPut(string method)
{ {
return object.ReferenceEquals(Put, method) || StringComparer.OrdinalIgnoreCase.Equals(Put, method); return object.ReferenceEquals(Put, method) || StringComparer.OrdinalIgnoreCase.Equals(Put, method);
@ -103,7 +127,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary> /// <summary>
/// Returns a value that indicates if the HTTP request method is TRACE. /// Returns a value that indicates if the HTTP request method is TRACE.
/// <summary/> /// <summary/>
/// <param name="method">HTTP request method.</param> /// <param name="method">The HTTP request method.</param>
/// <returns>
/// The System.Boolean.
/// </returns>
public static bool IsTrace(string method) public static bool IsTrace(string method)
{ {
return object.ReferenceEquals(Trace, method) || StringComparer.OrdinalIgnoreCase.Equals(Trace, method); return object.ReferenceEquals(Trace, method) || StringComparer.OrdinalIgnoreCase.Equals(Trace, method);

View File

@ -36,7 +36,7 @@ namespace Microsoft.AspNetCore.Http
private DefaultWebSocketManager _websockets; private DefaultWebSocketManager _websockets;
/// <summary> /// <summary>
/// Initializes a new instance of the DefaultHttpContext class. /// Initializes a new instance of the <see cref="DefaultHttpContext"/> class.
/// <summary/> /// <summary/>
public DefaultHttpContext() public DefaultHttpContext()
: this(new FeatureCollection()) : this(new FeatureCollection())
@ -47,9 +47,9 @@ namespace Microsoft.AspNetCore.Http
} }
/// <summary> /// <summary>
/// Initializes a new instance of the DefaultHttpContext class with options passed in. /// Initializes a new instance of the <see cref="DefaultHttpContext"/> class with provided features.
/// <summary/> /// <summary/>
/// <param name="features">Options to set when instantianting the Default HTTP context object.</param> /// <param name="features">Initial set of features for the <see cref="DefaultHttpContext"/>.</param>
public DefaultHttpContext(IFeatureCollection features) public DefaultHttpContext(IFeatureCollection features)
{ {
_features.Initalize(features); _features.Initalize(features);
@ -58,9 +58,12 @@ namespace Microsoft.AspNetCore.Http
} }
/// <summary> /// <summary>
/// Initialize the current instant of the class with options passed in. /// Reinitialize the current instant of the class with features passed in.
/// <summary/> /// <summary/>
/// <param name="features">Options to initialize the Default HTTP context object.</param> /// <remarks>
/// This method allows the consumer to re-use the <see cref="DefaultHttpContext" /> for another request, rather than having to allocate a new instance.
/// <remarks>
/// <param name="features">The new set of features for the <see cref="DefaultHttpContext" />.</param>
public void Initialize(IFeatureCollection features) public void Initialize(IFeatureCollection features)
{ {
var revision = features.Revision; var revision = features.Revision;
@ -72,7 +75,7 @@ namespace Microsoft.AspNetCore.Http
} }
/// <summary> /// <summary>
/// Uninitialize the child request, response, connection and websocket object features and reset the class instance features. /// Uninitialize all the features in the <see cref="DefaultHttpContext" />.
/// <summary/> /// <summary/>
public void Uninitialize() public void Uninitialize()
{ {
@ -84,13 +87,19 @@ namespace Microsoft.AspNetCore.Http
} }
/// <summary> /// <summary>
/// Gets or set the FormOptions for this instance. /// Gets or set the <see cref="FormOptions" /> for this instance.
/// <summary/> /// <summary/>
/// <returns>
/// The Microsoft.AspNetCore.Http.Features.FormOptions.
/// </returns>
public FormOptions FormOptions { get; set; } public FormOptions FormOptions { get; set; }
/// <summary> /// <summary>
/// Gets or sets the IServiceScopeFactory for this instance. /// Gets or sets the <see cref="IServiceScopeFactory" /> for this instance.
/// <summary/> /// <summary/>
/// <returns>
/// The Microsoft.Extensions.DependencyInjection.IServiceScopeFactory.
/// </returns>
public IServiceScopeFactory ServiceScopeFactory { get; set; } public IServiceScopeFactory ServiceScopeFactory { get; set; }
private IItemsFeature ItemsFeature => private IItemsFeature ItemsFeature =>
@ -115,43 +124,22 @@ namespace Microsoft.AspNetCore.Http
private IHttpRequestIdentifierFeature RequestIdentifierFeature => private IHttpRequestIdentifierFeature RequestIdentifierFeature =>
_features.Fetch(ref _features.Cache.RequestIdentifier, _newHttpRequestIdentifierFeature); _features.Fetch(ref _features.Cache.RequestIdentifier, _newHttpRequestIdentifierFeature);
/// <summary> /// <inheritdoc/>
/// Returns the Features for this instance. If null, an ObjectDisposedException Exceptioon is thrown.
/// <summary/>
public override IFeatureCollection Features => _features.Collection ?? ContextDisposed(); public override IFeatureCollection Features => _features.Collection ?? ContextDisposed();
/// <summary> /// <inheritdoc/>
/// Returns the HttpRequest of this instance.
/// <summary/>
public override HttpRequest Request => _request; public override HttpRequest Request => _request;
/// <summary> /// <inheritdoc/>
/// Returns the HttpResponse of this instance.
/// <summary/>
public override HttpResponse Response => _response; public override HttpResponse Response => _response;
/// <summary> /// <inheritdoc/>
/// Returns the connection information of this instance.
/// <summary/>
/// <remarks>
/// If the Connection is null, a new DefaultConnectionInfo object is instantiated using the Features collection of this instance.
/// <remarks/>
public override ConnectionInfo Connection => _connection ?? (_connection = new DefaultConnectionInfo(Features)); public override ConnectionInfo Connection => _connection ?? (_connection = new DefaultConnectionInfo(Features));
/// <summary> /// <inheritdoc/>
/// Returns the Web Socket Manager of this instance.
/// <summary/>
/// <remarks>
/// If the Connection is null, a new DefaultWebSocketManager object is instantiated using the Features collection of this instance.
/// <remarks/>
public override WebSocketManager WebSockets => _websockets ?? (_websockets = new DefaultWebSocketManager(Features)); public override WebSocketManager WebSockets => _websockets ?? (_websockets = new DefaultWebSocketManager(Features));
/// <summary> /// <inheritdoc/>
/// Gets or sets the claims principal of this instance.
/// <summary/>
/// <remarks>
/// If the ClaimsPrincipal object is null, a new ClaimsPrincipal object is instantiated.
/// <remarks/>
public override ClaimsPrincipal User public override ClaimsPrincipal User
{ {
get get
@ -167,48 +155,35 @@ namespace Microsoft.AspNetCore.Http
set { HttpAuthenticationFeature.User = value; } set { HttpAuthenticationFeature.User = value; }
} }
/// <summary> /// <inheritdoc/>
/// Gets or sets the item feature object(s) of this instance.
/// <summary/>
public override IDictionary<object, object> Items public override IDictionary<object, object> Items
{ {
get { return ItemsFeature.Items; } get { return ItemsFeature.Items; }
set { ItemsFeature.Items = value; } set { ItemsFeature.Items = value; }
} }
/// <summary> /// <inheritdoc/>
/// Gets or sets the service provider feature object of this instance.
/// <summary/>
public override IServiceProvider RequestServices public override IServiceProvider RequestServices
{ {
get { return ServiceProvidersFeature.RequestServices; } get { return ServiceProvidersFeature.RequestServices; }
set { ServiceProvidersFeature.RequestServices = value; } set { ServiceProvidersFeature.RequestServices = value; }
} }
/// <summary> /// <inheritdoc/>
/// Gets or sets the cancellation token object of this instance.
/// <summary/>
public override CancellationToken RequestAborted public override CancellationToken RequestAborted
{ {
get { return LifetimeFeature.RequestAborted; } get { return LifetimeFeature.RequestAborted; }
set { LifetimeFeature.RequestAborted = value; } set { LifetimeFeature.RequestAborted = value; }
} }
/// <summary> /// <inheritdoc/>
/// Gets or sets the trace identifier of this instance.
/// <summary/>
public override string TraceIdentifier public override string TraceIdentifier
{ {
get { return RequestIdentifierFeature.TraceIdentifier; } get { return RequestIdentifierFeature.TraceIdentifier; }
set { RequestIdentifierFeature.TraceIdentifier = value; } set { RequestIdentifierFeature.TraceIdentifier = value; }
} }
/// <summary> /// <inheritdoc/>
/// Gets or sets the session of this instance.
/// <summary/>
/// <remarks>
/// If session feature has not been set, an Invalid Operation Exception is thrown.
/// <remarks/>
public override ISession Session public override ISession Session
{ {
get get
@ -234,6 +209,7 @@ namespace Microsoft.AspNetCore.Http
[EditorBrowsable(EditorBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)]
public HttpContext HttpContext => this; public HttpContext HttpContext => this;
/// <inheritdoc/>
public override void Abort() public override void Abort()
{ {
LifetimeFeature.Abort(); LifetimeFeature.Abort();

View File

@ -6,15 +6,13 @@ using System.Threading;
namespace Microsoft.AspNetCore.Http namespace Microsoft.AspNetCore.Http
{ {
/// <summary> /// <summary>
/// Represents the properties and methods used to access the current HTTP context. /// Provides an implementation of <see cref="IHttpContextAccessor" /> based on the current execution context.
/// <summary/> /// <summary/>
public class HttpContextAccessor : IHttpContextAccessor public class HttpContextAccessor : IHttpContextAccessor
{ {
private static AsyncLocal<HttpContextHolder> _httpContextCurrent = new AsyncLocal<HttpContextHolder>(); private static AsyncLocal<HttpContextHolder> _httpContextCurrent = new AsyncLocal<HttpContextHolder>();
/// <summary> /// <inheritdoc/>
/// Gets or sets the HTTP context.
/// <summary/>
public HttpContext HttpContext public HttpContext HttpContext
{ {
get get

View File

@ -14,7 +14,7 @@ using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.HttpsPolicy namespace Microsoft.AspNetCore.HttpsPolicy
{ {
/// <summary> /// <summary>
/// Provides functionality to redirect client requests to an address that uses the HTTPS protocol. /// Middleware that redirects non-HTTPS requests to an HTTPS URL.
/// </summary> /// </summary>
public class HttpsRedirectionMiddleware public class HttpsRedirectionMiddleware
{ {
@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.HttpsPolicy
} }
/// <summary> /// <summary>
/// Initializes the HttpsRedirectionMiddleware. /// Initializes <see cref="HttpsRedirectionMiddleware" />.
/// </summary> /// </summary>
/// <param name="next"></param> /// <param name="next"></param>
/// <param name="options"></param> /// <param name="options"></param>
@ -74,7 +74,7 @@ namespace Microsoft.AspNetCore.HttpsPolicy
} }
/// <summary> /// <summary>
/// Invokes the HttpsRedirectionMiddleware /// Invokes the HttpsRedirectionMiddleware.
/// </summary> /// </summary>
/// <param name="context"></param> /// <param name="context"></param>
/// <returns></returns> /// <returns></returns>