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>
/// Returns a value that indicates if the HTTP request method is CONNECT.
/// <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)
{
return object.ReferenceEquals(Connect, method) || StringComparer.OrdinalIgnoreCase.Equals(Connect, method);
@ -40,7 +43,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary>
/// Returns a value that indicates if the HTTP request method is DELETE.
/// <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)
{
return object.ReferenceEquals(Delete, method) || StringComparer.OrdinalIgnoreCase.Equals(Delete, method);
@ -49,7 +55,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary>
/// Returns a value that indicates if the HTTP request method is GET.
/// <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)
{
return object.ReferenceEquals(Get, method) || StringComparer.OrdinalIgnoreCase.Equals(Get, method);
@ -58,7 +67,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary>
/// Returns a value that indicates if the HTTP request method is HEAD.
/// <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)
{
return object.ReferenceEquals(Head, method) || StringComparer.OrdinalIgnoreCase.Equals(Head, method);
@ -67,7 +79,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary>
/// Returns a value that indicates if the HTTP request method is OPTIONS.
/// <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)
{
return object.ReferenceEquals(Options, method) || StringComparer.OrdinalIgnoreCase.Equals(Options, method);
@ -76,7 +91,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary>
/// Returns a value that indicates if the HTTP request method is PATCH.
/// <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)
{
return object.ReferenceEquals(Patch, method) || StringComparer.OrdinalIgnoreCase.Equals(Patch, method);
@ -85,7 +103,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary>
/// Returns a value that indicates if the HTTP request method is POST.
/// <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)
{
return object.ReferenceEquals(Post, method) || StringComparer.OrdinalIgnoreCase.Equals(Post, method);
@ -94,7 +115,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary>
/// Returns a value that indicates if the HTTP request method is PUT.
/// <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)
{
return object.ReferenceEquals(Put, method) || StringComparer.OrdinalIgnoreCase.Equals(Put, method);
@ -103,7 +127,10 @@ namespace Microsoft.AspNetCore.Http
/// <summary>
/// Returns a value that indicates if the HTTP request method is TRACE.
/// <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)
{
return object.ReferenceEquals(Trace, method) || StringComparer.OrdinalIgnoreCase.Equals(Trace, method);

View File

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

View File

@ -6,15 +6,13 @@ using System.Threading;
namespace Microsoft.AspNetCore.Http
{
/// <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/>
public class HttpContextAccessor : IHttpContextAccessor
{
private static AsyncLocal<HttpContextHolder> _httpContextCurrent = new AsyncLocal<HttpContextHolder>();
/// <summary>
/// Gets or sets the HTTP context.
/// <summary/>
/// <inheritdoc/>
public HttpContext HttpContext
{
get

View File

@ -14,7 +14,7 @@ using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.HttpsPolicy
{
/// <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>
public class HttpsRedirectionMiddleware
{
@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.HttpsPolicy
}
/// <summary>
/// Initializes the HttpsRedirectionMiddleware.
/// Initializes <see cref="HttpsRedirectionMiddleware" />.
/// </summary>
/// <param name="next"></param>
/// <param name="options"></param>
@ -74,7 +74,7 @@ namespace Microsoft.AspNetCore.HttpsPolicy
}
/// <summary>
/// Invokes the HttpsRedirectionMiddleware
/// Invokes the HttpsRedirectionMiddleware.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>