parent
ed5a43d5ad
commit
10d5a0ba62
|
|
@ -7,7 +7,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
{
|
||||
/// <summary>
|
||||
/// Contains methods to verify the request method of an HTTP request.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
public static class HttpMethods
|
||||
{
|
||||
// We are intentionally using 'static readonly' here instead of 'const'.
|
||||
|
|
@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Returns a value that indicates if the HTTP request method is CONNECT.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="method">The HTTP request method.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if the method is CONNECT; otherwise, <see langword="false" />.
|
||||
|
|
@ -42,7 +42,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Returns a value that indicates if the HTTP request method is DELETE.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="method">The HTTP request method.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if the method is DELETE; otherwise, <see langword="false" />.
|
||||
|
|
@ -54,7 +54,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Returns a value that indicates if the HTTP request method is GET.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="method">The HTTP request method.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if the method is GET; otherwise, <see langword="false" />.
|
||||
|
|
@ -66,7 +66,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Returns a value that indicates if the HTTP request method is HEAD.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="method">The HTTP request method.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if the method is HEAD; otherwise, <see langword="false" />.
|
||||
|
|
@ -78,7 +78,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Returns a value that indicates if the HTTP request method is OPTIONS.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="method">The HTTP request method.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if the method is OPTIONS; otherwise, <see langword="false" />.
|
||||
|
|
@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Returns a value that indicates if the HTTP request method is PATCH.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="method">The HTTP request method.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if the method is PATCH; otherwise, <see langword="false" />.
|
||||
|
|
@ -102,7 +102,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Returns a value that indicates if the HTTP request method is POST.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="method">The HTTP request method.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if the method is POST; otherwise, <see langword="false" />.
|
||||
|
|
@ -114,7 +114,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Returns a value that indicates if the HTTP request method is PUT.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="method">The HTTP request method.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if the method is PUT; otherwise, <see langword="false" />.
|
||||
|
|
@ -126,7 +126,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Returns a value that indicates if the HTTP request method is TRACE.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="method">The HTTP request method.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if the method is TRACE; otherwise, <see langword="false" />.
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
{
|
||||
/// <summary>
|
||||
/// Represents an implementation of the HTTP Context class.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
public sealed class DefaultHttpContext : HttpContext
|
||||
{
|
||||
// Lambdas hoisted to static readonly fields to improve inlining https://github.com/dotnet/roslyn/issues/13624
|
||||
|
|
@ -37,7 +37,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DefaultHttpContext"/> class.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
public DefaultHttpContext()
|
||||
: this(new FeatureCollection())
|
||||
{
|
||||
|
|
@ -48,7 +48,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DefaultHttpContext"/> class with provided features.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="features">Initial set of features for the <see cref="DefaultHttpContext"/>.</param>
|
||||
public DefaultHttpContext(IFeatureCollection features)
|
||||
{
|
||||
|
|
@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Reinitialize the current instant of the class with features passed in.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <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>
|
||||
|
|
@ -76,7 +76,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Uninitialize all the features in the <see cref="DefaultHttpContext" />.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
public void Uninitialize()
|
||||
{
|
||||
_features = default;
|
||||
|
|
@ -88,7 +88,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Gets or set the <see cref="FormOptions" /> for this instance.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// <see cref="FormOptions"/>
|
||||
/// </returns>
|
||||
|
|
@ -96,7 +96,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="IServiceScopeFactory" /> for this instance.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// <see cref="IServiceScopeFactory"/>
|
||||
/// </returns>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
{
|
||||
/// <summary>
|
||||
/// Provides an implementation of <see cref="IHttpContextAccessor" /> based on the current execution context.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
public class HttpContextAccessor : IHttpContextAccessor
|
||||
{
|
||||
private static AsyncLocal<HttpContextHolder> _httpContextCurrent = new AsyncLocal<HttpContextHolder>();
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
{
|
||||
/// <summary>
|
||||
/// Represents methods used to create an HTTP context object.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
[Obsolete("This is obsolete and will be removed in a future version. Use DefaultHttpContextFactory instead.")]
|
||||
public class HttpContextFactory : IHttpContextFactory
|
||||
{
|
||||
|
|
@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the HttpContext class with options passed in.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="formOptions">Options to set when instantianting the HTTP context object.</param>
|
||||
public HttpContextFactory(IOptions<FormOptions> formOptions)
|
||||
: this(formOptions, serviceScopeFactory: null)
|
||||
|
|
@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the DefaultHttpContext class with options passed in.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="formOptions">Options to set when instantianting the HTTP context object.</param>
|
||||
/// <param name="serviceScopeFactory">Factory object used to create the service scope for the HTTP context.</param>
|
||||
public HttpContextFactory(IOptions<FormOptions> formOptions, IServiceScopeFactory serviceScopeFactory)
|
||||
|
|
@ -39,7 +39,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the DefaultHttpContext class with options passed in.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="formOptions">Options to set when instantianting the HTTP context object.</param>
|
||||
/// <param name="httpContextAccessor">Object to be used to access the HTTP context instance.</param>
|
||||
public HttpContextFactory(IOptions<FormOptions> formOptions, IHttpContextAccessor httpContextAccessor)
|
||||
|
|
@ -49,7 +49,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the DefaultHttpContext class with options passed in.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="formOptions">Options to set when instantianting the HTTP context object.</param>
|
||||
/// <param name="serviceScopeFactory">Factory object used to create the service scope for the HTTP context.</param>
|
||||
/// <param name="httpContextAccessor">Options to set when instantianting the Default HTTP context object.</param>
|
||||
|
|
@ -72,7 +72,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the DefaultHttpContext class with options passed in.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="featureCollection">Options to set when instantianting the Default HTTP context object.</param>
|
||||
public HttpContext Create(IFeatureCollection featureCollection)
|
||||
{
|
||||
|
|
@ -95,7 +95,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
|
||||
/// <summary>
|
||||
/// Sets the HTTP context object to null for garbage collection.
|
||||
/// <summary/>
|
||||
/// </summary>
|
||||
/// <param name="httpContext">HTTP context to dispose.</param>
|
||||
public void Dispose(HttpContext httpContext)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue