Move some implementations (all feature implementations) out of `.Internal` namespaces

- #549, #592
- move feature implementations to `Microsoft.AspNetCore.Http.Features` and `...Authentication.Features`
- move `DefaultHttpContext`, `HttpContextAccessor`, `HttpContextFactory`, `FormCollection` and
  `HeaderDictionary` to `Microsoft.AspNetCore.Http`
- move `FormFile` to `Microsoft.AspNetCore.Http.Internal`
 - that and `Microsoft.AspNetCore.Http.Authentication.Internal` are the remaining `.Internal` namespaces

nits:
- remove a couple of parameterless constructors
- add / fill subfolders to align with new namespaces
- remove all use of (unnecessary) "T:..." `<see cref=""/>` values
This commit is contained in:
Doug Bunting 2016-03-27 00:51:12 -07:00
parent ff0a37c5f5
commit 6725d68559
66 changed files with 128 additions and 175 deletions

View File

@ -12,7 +12,7 @@ namespace SampleApp
DefaultHttpRequest _pooledHttpRequest;
DefaultHttpResponse _pooledHttpResponse;
public PooledHttpContext(IFeatureCollection featureCollection) :
public PooledHttpContext(IFeatureCollection featureCollection) :
base(featureCollection)
{
}

View File

@ -6,7 +6,6 @@ using System.Collections.Generic;
using System.Text;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Features.Internal;
using Microsoft.Extensions.ObjectPool;
namespace SampleApp

View File

@ -4,7 +4,6 @@
using System;
using Microsoft.Extensions.Primitives;
namespace Microsoft.AspNetCore.Http.Internal
{
internal struct HeaderSegment : IEquatable<HeaderSegment>
@ -13,7 +12,7 @@ namespace Microsoft.AspNetCore.Http.Internal
private readonly StringSegment _data;
// <summary>
// Initializes a new instance of the <see cref="T:System.Object"/> class.
// Initializes a new instance of the <see cref="HeaderSegment/> structure.
// </summary>
public HeaderSegment(StringSegment formatting, StringSegment data)
{

View File

@ -12,35 +12,35 @@ namespace Microsoft.AspNetCore.Http
public interface IFormCollection : IEnumerable<KeyValuePair<string, StringValues>>
{
/// <summary>
/// Gets the number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />.
/// Gets the number of elements contained in the <see cref="IFormCollection" />.
/// </summary>
/// <returns>
/// The number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />.
/// The number of elements contained in the <see cref="IFormCollection" />.
/// </returns>
int Count { get; }
/// <summary>
/// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the
/// <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />.
/// Gets an <see cref="ICollection{T}" /> containing the keys of the
/// <see cref="IFormCollection" />.
/// </summary>
/// <returns>
/// An <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the object
/// that implements <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />.
/// An <see cref="ICollection{T}" /> containing the keys of the object
/// that implements <see cref="IFormCollection" />.
/// </returns>
ICollection<string> Keys { get; }
/// <summary>
/// Determines whether the <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" /> contains an element
/// Determines whether the <see cref="IFormCollection" /> contains an element
/// with the specified key.
/// </summary>
/// <param name="key">
/// The key to locate in the <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />.
/// The key to locate in the <see cref="IFormCollection" />.
/// </param>
/// <returns>
/// true if the <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" /> contains an element with
/// true if the <see cref="IFormCollection" /> contains an element with
/// the key; otherwise, false.
/// </returns>
/// <exception cref="T:System.ArgumentNullException">
/// <exception cref="System.ArgumentNullException">
/// key is null.
/// </exception>
bool ContainsKey(string key);
@ -58,10 +58,10 @@ namespace Microsoft.AspNetCore.Http
/// This parameter is passed uninitialized.
/// </param>
/// <returns>
/// true if the object that implements <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" /> contains
/// true if the object that implements <see cref="IFormCollection" /> contains
/// an element with the specified key; otherwise, false.
/// </returns>
/// <exception cref="T:System.ArgumentNullException">
/// <exception cref="System.ArgumentNullException">
/// key is null.
/// </exception>
bool TryGetValue(string key, out StringValues value);
@ -73,14 +73,14 @@ namespace Microsoft.AspNetCore.Http
/// The key of the value to get.
/// </param>
/// <returns>
/// The element with the specified key, or <see cref="T:Microsoft.Extensions.Primitives.StringValues" />.Empty if the key is not present.
/// The element with the specified key, or <c>StringValues.Empty</c> if the key is not present.
/// </returns>
/// <exception cref="T:System.ArgumentNullException">
/// <exception cref="System.ArgumentNullException">
/// key is null.
/// </exception>
/// <remarks>
/// <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" /> has a different indexer contract than
/// <see cref="T:System.Collections.Generic.IDictionary`2" />, as it will return StringValues.Empty for missing entries
/// <see cref="IFormCollection" /> has a different indexer contract than
/// <see cref="IDictionary{TKey, TValue}" />, as it will return <c>StringValues.Empty</c> for missing entries
/// rather than throwing an Exception.
/// </remarks>
StringValues this[string key] { get; }

View File

@ -12,35 +12,35 @@ namespace Microsoft.AspNetCore.Http
public interface IQueryCollection : IEnumerable<KeyValuePair<string, StringValues>>
{
/// <summary>
/// Gets the number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" />.
/// Gets the number of elements contained in the <see cref="IQueryCollection" />.
/// </summary>
/// <returns>
/// The number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" />.
/// The number of elements contained in the <see cref="IQueryCollection" />.
/// </returns>
int Count { get; }
/// <summary>
/// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the
/// <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" />.
/// Gets an <see cref="ICollection{T}" /> containing the keys of the
/// <see cref="IQueryCollection" />.
/// </summary>
/// <returns>
/// An <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the object
/// that implements <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" />.
/// An <see cref="ICollection{T}" /> containing the keys of the object
/// that implements <see cref="IQueryCollection" />.
/// </returns>
ICollection<string> Keys { get; }
/// <summary>
/// Determines whether the <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" /> contains an element
/// Determines whether the <see cref="IQueryCollection" /> contains an element
/// with the specified key.
/// </summary>
/// <param name="key">
/// The key to locate in the <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" />.
/// The key to locate in the <see cref="IQueryCollection" />.
/// </param>
/// <returns>
/// true if the <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" /> contains an element with
/// true if the <see cref="IQueryCollection" /> contains an element with
/// the key; otherwise, false.
/// </returns>
/// <exception cref="T:System.ArgumentNullException">
/// <exception cref="System.ArgumentNullException">
/// key is null.
/// </exception>
bool ContainsKey(string key);
@ -58,10 +58,10 @@ namespace Microsoft.AspNetCore.Http
/// This parameter is passed uninitialized.
/// </param>
/// <returns>
/// true if the object that implements <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" /> contains
/// true if the object that implements <see cref="IQueryCollection" /> contains
/// an element with the specified key; otherwise, false.
/// </returns>
/// <exception cref="T:System.ArgumentNullException">
/// <exception cref="System.ArgumentNullException">
/// key is null.
/// </exception>
bool TryGetValue(string key, out StringValues value);
@ -73,15 +73,14 @@ namespace Microsoft.AspNetCore.Http
/// The key of the value to get.
/// </param>
/// <returns>
/// The element with the specified key, or <see cref="T:Microsoft.Extensions.Primitives.StringValues" />.
/// Empty if the key is not present.
/// The element with the specified key, or <c>StringValues.Empty</c> if the key is not present.
/// </returns>
/// <exception cref="T:System.ArgumentNullException">
/// <exception cref="System.ArgumentNullException">
/// key is null.
/// </exception>
/// <remarks>
/// <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" /> has a different indexer contract than
/// <see cref="T:System.Collections.Generic.IDictionary`2" />, as it will return StringValues.Empty for missing entries
/// <see cref="IQueryCollection" /> has a different indexer contract than
/// <see cref="IDictionary{TKey, TValue}" />, as it will return <c>StringValues.Empty</c> for missing entries
/// rather than throwing an Exception.
/// </remarks>
StringValues this[string key] { get; }

View File

@ -11,35 +11,35 @@ namespace Microsoft.AspNetCore.Http
public interface IRequestCookieCollection : IEnumerable<KeyValuePair<string, string>>
{
/// <summary>
/// Gets the number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
/// Gets the number of elements contained in the <see cref="IRequestCookieCollection" />.
/// </summary>
/// <returns>
/// The number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
/// The number of elements contained in the <see cref="IRequestCookieCollection" />.
/// </returns>
int Count { get; }
/// <summary>
/// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the
/// <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
/// Gets an <see cref="ICollection{T}" /> containing the keys of the
/// <see cref="IRequestCookieCollection" />.
/// </summary>
/// <returns>
/// An <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the object
/// that implements <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
/// An <see cref="ICollection{T}" /> containing the keys of the object
/// that implements <see cref="IRequestCookieCollection" />.
/// </returns>
ICollection<string> Keys { get; }
/// <summary>
/// Determines whether the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" /> contains an element
/// Determines whether the <see cref="IRequestCookieCollection" /> contains an element
/// with the specified key.
/// </summary>
/// <param name="key">
/// The key to locate in the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
/// The key to locate in the <see cref="IRequestCookieCollection" />.
/// </param>
/// <returns>
/// true if the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" /> contains an element with
/// true if the <see cref="IRequestCookieCollection" /> contains an element with
/// the key; otherwise, false.
/// </returns>
/// <exception cref="T:System.ArgumentNullException">
/// <exception cref="System.ArgumentNullException">
/// key is null.
/// </exception>
bool ContainsKey(string key);
@ -57,10 +57,10 @@ namespace Microsoft.AspNetCore.Http
/// This parameter is passed uninitialized.
/// </param>
/// <returns>
/// true if the object that implements <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" /> contains
/// true if the object that implements <see cref="IRequestCookieCollection" /> contains
/// an element with the specified key; otherwise, false.
/// </returns>
/// <exception cref="T:System.ArgumentNullException">
/// <exception cref="System.ArgumentNullException">
/// key is null.
/// </exception>
bool TryGetValue(string key, out string value);
@ -72,14 +72,14 @@ namespace Microsoft.AspNetCore.Http
/// The key of the value to get.
/// </param>
/// <returns>
/// The element with the specified key, or <see cref="T:System.String" />.Empty if the key is not present.
/// The element with the specified key, or <c>string.Empty</c> if the key is not present.
/// </returns>
/// <exception cref="T:System.ArgumentNullException">
/// <exception cref="System.ArgumentNullException">
/// key is null.
/// </exception>
/// <remarks>
/// <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" /> has a different indexer contract than
/// <see cref="T:System.Collections.Generic.IDictionary`2" />, as it will return String.Empty for missing entries
/// <see cref="IRequestCookieCollection" /> has a different indexer contract than
/// <see cref="IDictionary{TKey, TValue}" />, as it will return <c>string.Empty</c> for missing entries
/// rather than throwing an Exception.
/// </remarks>
string this[string key] { get; }

View File

@ -8,7 +8,6 @@ using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Features.Authentication;
using Microsoft.AspNetCore.Http.Features.Authentication.Internal;
namespace Microsoft.AspNetCore.Http.Authentication.Internal
{

View File

@ -9,10 +9,9 @@ using Microsoft.AspNetCore.Http.Authentication;
using Microsoft.AspNetCore.Http.Authentication.Internal;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Features.Authentication;
using Microsoft.AspNetCore.Http.Features.Authentication.Internal;
using Microsoft.AspNetCore.Http.Features.Internal;
using Microsoft.AspNetCore.Http.Internal;
namespace Microsoft.AspNetCore.Http.Internal
namespace Microsoft.AspNetCore.Http
{
public class DefaultHttpContext : HttpContext
{
@ -72,7 +71,7 @@ namespace Microsoft.AspNetCore.Http.Internal
_websockets = null;
}
}
private IItemsFeature ItemsFeature =>
_features.Fetch(ref _features.Cache.Items, f => new ItemsFeature());
@ -165,7 +164,7 @@ namespace Microsoft.AspNetCore.Http.Internal
}
}
public override void Abort()
{

View File

@ -3,14 +3,10 @@
using System.Security.Claims;
namespace Microsoft.AspNetCore.Http.Features.Authentication.Internal
namespace Microsoft.AspNetCore.Http.Features.Authentication
{
public class HttpAuthenticationFeature : IHttpAuthenticationFeature
{
public HttpAuthenticationFeature()
{
}
public ClaimsPrincipal User
{
get;

View File

@ -1,7 +1,7 @@
// 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.
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
/// <summary>
/// This type exists only for the purpose of unit testing where the user can directly set the

View File

@ -10,7 +10,7 @@ using Microsoft.AspNetCore.Http.Internal;
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
public class FormFeature : IFormFeature
{

View File

@ -3,14 +3,10 @@
using System.Net;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
public class HttpConnectionFeature : IHttpConnectionFeature
{
public HttpConnectionFeature()
{
}
public string ConnectionId { get; set; }
public IPAddress LocalIpAddress { get; set; }

View File

@ -2,9 +2,8 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.IO;
using Microsoft.AspNetCore.Http.Internal;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
public class HttpRequestFeature : IHttpRequestFeature
{

View File

@ -4,7 +4,7 @@
using System;
using System.Threading;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
public class HttpRequestIdentifierFeature : IHttpRequestIdentifierFeature
{

View File

@ -3,7 +3,7 @@
using System.Threading;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
public class HttpRequestLifetimeFeature : IHttpRequestLifetimeFeature
{

View File

@ -4,9 +4,8 @@
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Internal;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
public class HttpResponseFeature : IHttpResponseFeature
{

View File

@ -4,7 +4,7 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Http.Internal;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
public class ItemsFeature : IItemsFeature
{

View File

@ -5,7 +5,7 @@ using System;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.AspNetCore.WebUtilities;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
public class QueryFeature : IQueryFeature
{

View File

@ -7,14 +7,14 @@ using Microsoft.AspNetCore.Http.Internal;
using Microsoft.Extensions.Primitives;
using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
public class RequestCookiesFeature : IRequestCookiesFeature
{
private FeatureReferences<IHttpRequestFeature> _features;
private StringValues _original;
private IRequestCookieCollection _parsedValues;
public RequestCookiesFeature(IRequestCookieCollection cookies)
{
if (cookies == null)

View File

@ -6,7 +6,7 @@ using System.Text;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.Extensions.ObjectPool;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
/// <summary>
/// Default implementation of <see cref="IResponseCookiesFeature"/>.

View File

@ -3,7 +3,7 @@
using System;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
public class ServiceProvidersFeature : IServiceProvidersFeature
{

View File

@ -5,14 +5,10 @@ using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
public class TlsConnectionFeature : ITlsConnectionFeature
{
public TlsConnectionFeature()
{
}
public X509Certificate2 ClientCertificate { get; set; }
public Task<X509Certificate2> GetClientCertificateAsync(CancellationToken cancellationToken)

View File

@ -4,9 +4,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.Extensions.Primitives;
namespace Microsoft.AspNetCore.Http.Internal
namespace Microsoft.AspNetCore.Http
{
/// <summary>
/// Contains the parsed form values.
@ -20,7 +21,7 @@ namespace Microsoft.AspNetCore.Http.Internal
#else
private static readonly string[] EmptyKeys = new string[0];
private static readonly StringValues[] EmptyValues = new StringValues[0];
#endif
#endif
private static readonly Enumerator EmptyEnumerator = new Enumerator();
// Pre-box
private static readonly IEnumerator<KeyValuePair<string, StringValues>> EmptyIEnumeratorType = EmptyEnumerator;
@ -77,9 +78,9 @@ namespace Microsoft.AspNetCore.Http.Internal
}
/// <summary>
/// Gets the number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" />;.
/// Gets the number of elements contained in the <see cref="HeaderDictionary" />;.
/// </summary>
/// <returns>The number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" />.</returns>
/// <returns>The number of elements contained in the <see cref="HeaderDictionary" />.</returns>
public int Count
{
get
@ -101,10 +102,10 @@ namespace Microsoft.AspNetCore.Http.Internal
}
/// <summary>
/// Determines whether the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" /> contains a specific key.
/// Determines whether the <see cref="HeaderDictionary" /> contains a specific key.
/// </summary>
/// <param name="key">The key.</param>
/// <returns>true if the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" /> contains a specific key; otherwise, false.</returns>
/// <returns>true if the <see cref="HeaderDictionary" /> contains a specific key; otherwise, false.</returns>
public bool ContainsKey(string key)
{
if (Store == null)
@ -119,7 +120,7 @@ namespace Microsoft.AspNetCore.Http.Internal
/// </summary>
/// <param name="key">The header name.</param>
/// <param name="value">The value.</param>
/// <returns>true if the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" /> contains the key; otherwise, false.</returns>
/// <returns>true if the <see cref="HeaderDictionary" /> contains the key; otherwise, false.</returns>
public bool TryGetValue(string key, out StringValues value)
{
if (Store == null)
@ -131,9 +132,9 @@ namespace Microsoft.AspNetCore.Http.Internal
}
/// <summary>
/// Returns an struct enumerator that iterates through a collection without boxing and is also used via the <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" /> interface.
/// Returns an struct enumerator that iterates through a collection without boxing and is also used via the <see cref="IFormCollection" /> interface.
/// </summary>
/// <returns>An <see cref="T:Microsoft.AspNetCore.Http.StructEnumerator" /> object that can be used to iterate through the collection.</returns>
/// <returns>An <see cref="Enumerator" /> object that can be used to iterate through the collection.</returns>
public Enumerator GetEnumerator()
{
if (Store == null || Store.Count == 0)
@ -148,7 +149,7 @@ namespace Microsoft.AspNetCore.Http.Internal
/// <summary>
/// Returns an enumerator that iterates through a collection, boxes in non-empty path.
/// </summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.</returns>
/// <returns>An <see cref="IEnumerator" /> object that can be used to iterate through the collection.</returns>
IEnumerator<KeyValuePair<string, StringValues>> IEnumerable<KeyValuePair<string, StringValues>>.GetEnumerator()
{
if (Store == null || Store.Count == 0)
@ -163,7 +164,7 @@ namespace Microsoft.AspNetCore.Http.Internal
/// <summary>
/// Returns an enumerator that iterates through a collection, boxes in non-empty path.
/// </summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.</returns>
/// <returns>An <see cref="IEnumerator" /> object that can be used to iterate through the collection.</returns>
IEnumerator IEnumerable.GetEnumerator()
{
if (Store == null || Store.Count == 0)

View File

@ -6,7 +6,7 @@ using System.Collections;
using System.Collections.Generic;
using Microsoft.Extensions.Primitives;
namespace Microsoft.AspNetCore.Http.Internal
namespace Microsoft.AspNetCore.Http
{
/// <summary>
/// Represents a wrapper for RequestHeaders and ResponseHeaders.
@ -19,13 +19,13 @@ namespace Microsoft.AspNetCore.Http.Internal
#else
private static readonly string[] EmptyKeys = new string[0];
private static readonly StringValues[] EmptyValues = new StringValues[0];
#endif
#endif
private static readonly Enumerator EmptyEnumerator = new Enumerator();
// Pre-box
private static readonly IEnumerator<KeyValuePair<string, StringValues>> EmptyIEnumeratorType = EmptyEnumerator;
private static readonly IEnumerator EmptyIEnumerator = EmptyEnumerator;
public HeaderDictionary()
public HeaderDictionary()
{
}
@ -98,9 +98,9 @@ namespace Microsoft.AspNetCore.Http.Internal
}
/// <summary>
/// Gets the number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" />;.
/// Gets the number of elements contained in the <see cref="HeaderDictionary" />;.
/// </summary>
/// <returns>The number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" />.</returns>
/// <returns>The number of elements contained in the <see cref="HeaderDictionary" />.</returns>
public int Count
{
get
@ -110,9 +110,9 @@ namespace Microsoft.AspNetCore.Http.Internal
}
/// <summary>
/// Gets a value that indicates whether the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" /> is in read-only mode.
/// Gets a value that indicates whether the <see cref="HeaderDictionary" /> is in read-only mode.
/// </summary>
/// <returns>true if the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" /> is in read-only mode; otherwise, false.</returns>
/// <returns>true if the <see cref="HeaderDictionary" /> is in read-only mode; otherwise, false.</returns>
public bool IsReadOnly
{
get
@ -207,10 +207,10 @@ namespace Microsoft.AspNetCore.Http.Internal
}
/// <summary>
/// Determines whether the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" /> contains a specific key.
/// Determines whether the <see cref="HeaderDictionary" /> contains a specific key.
/// </summary>
/// <param name="key">The key.</param>
/// <returns>true if the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" /> contains a specific key; otherwise, false.</returns>
/// <returns>true if the <see cref="HeaderDictionary" /> contains a specific key; otherwise, false.</returns>
public bool ContainsKey(string key)
{
if (Store == null)
@ -221,9 +221,9 @@ namespace Microsoft.AspNetCore.Http.Internal
}
/// <summary>
/// Copies the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" /> elements to a one-dimensional Array instance at the specified index.
/// Copies the <see cref="HeaderDictionary" /> elements to a one-dimensional Array instance at the specified index.
/// </summary>
/// <param name="array">The one-dimensional Array that is the destination of the specified objects copied from the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" />.</param>
/// <param name="array">The one-dimensional Array that is the destination of the specified objects copied from the <see cref="HeaderDictionary" />.</param>
/// <param name="arrayIndex">The zero-based index in <paramref name="array" /> at which copying begins.</param>
public void CopyTo(KeyValuePair<string, StringValues>[] array, int arrayIndex)
{
@ -279,7 +279,7 @@ namespace Microsoft.AspNetCore.Http.Internal
/// </summary>
/// <param name="key">The header name.</param>
/// <param name="value">The value.</param>
/// <returns>true if the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" /> contains the key; otherwise, false.</returns>
/// <returns>true if the <see cref="HeaderDictionary" /> contains the key; otherwise, false.</returns>
public bool TryGetValue(string key, out StringValues value)
{
if (Store == null)
@ -293,7 +293,7 @@ namespace Microsoft.AspNetCore.Http.Internal
/// <summary>
/// Returns an enumerator that iterates through a collection.
/// </summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.</returns>
/// <returns>An <see cref="Enumerator" /> object that can be used to iterate through the collection.</returns>
public Enumerator GetEnumerator()
{
if (Store == null || Store.Count == 0)
@ -307,7 +307,7 @@ namespace Microsoft.AspNetCore.Http.Internal
/// <summary>
/// Returns an enumerator that iterates through a collection.
/// </summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.</returns>
/// <returns>An <see cref="IEnumerator" /> object that can be used to iterate through the collection.</returns>
IEnumerator<KeyValuePair<string, StringValues>> IEnumerable<KeyValuePair<string, StringValues>>.GetEnumerator()
{
if (Store == null || Store.Count == 0)
@ -321,7 +321,7 @@ namespace Microsoft.AspNetCore.Http.Internal
/// <summary>
/// Returns an enumerator that iterates through a collection.
/// </summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.</returns>
/// <returns>An <see cref="IEnumerator" /> object that can be used to iterate through the collection.</returns>
IEnumerator IEnumerable.GetEnumerator()
{
if (Store == null || Store.Count == 0)

View File

@ -1,15 +1,14 @@
// 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;
#if NET451
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Messaging;
#elif NETSTANDARD1_3
using System.Threading;
#endif
namespace Microsoft.AspNetCore.Http.Internal
namespace Microsoft.AspNetCore.Http
{
public class HttpContextAccessor : IHttpContextAccessor
{

View File

@ -4,10 +4,9 @@
using System;
using System.Text;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Features.Internal;
using Microsoft.Extensions.ObjectPool;
namespace Microsoft.AspNetCore.Http.Internal
namespace Microsoft.AspNetCore.Http
{
public class HttpContextFactory : IHttpContextFactory
{

View File

@ -6,7 +6,6 @@ using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Features.Internal;
namespace Microsoft.AspNetCore.Http.Internal
{

View File

@ -6,7 +6,6 @@ using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Features.Internal;
using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Http.Internal

View File

@ -5,7 +5,6 @@ using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Features.Internal;
using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Http.Internal
@ -37,7 +36,7 @@ namespace Microsoft.AspNetCore.Http.Internal
private IResponseCookiesFeature ResponseCookiesFeature =>
_features.Fetch(ref _features.Cache.Cookies, f => new ResponseCookiesFeature(f));
public override HttpContext HttpContext { get { return _context; } }

View File

@ -5,9 +5,8 @@ using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Internal;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Internal
{
public class FormFile : IFormFile
{

View File

@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Http.Internal
private readonly StringSegment _data;
// <summary>
// Initializes a new instance of the <see cref="T:System.Object"/> class.
// Initializes a new instance of the <see cref="HeaderSegment"/> structure.
// </summary>
public HeaderSegment(StringSegment formatting, StringSegment data)
{

View File

@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Http.Internal
#else
private static readonly string[] EmptyKeys = new string[0];
private static readonly StringValues[] EmptyValues = new StringValues[0];
#endif
#endif
private static readonly Enumerator EmptyEnumerator = new Enumerator();
// Pre-box
private static readonly IEnumerator<KeyValuePair<string, StringValues>> EmptyIEnumeratorType = EmptyEnumerator;
@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore.Http.Internal
private Dictionary<string, StringValues> Store { get; set; }
public QueryCollection()
public QueryCollection()
{
}
@ -71,9 +71,9 @@ namespace Microsoft.AspNetCore.Http.Internal
}
/// <summary>
/// Gets the number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" />;.
/// Gets the number of elements contained in the <see cref="HeaderDictionary" />;.
/// </summary>
/// <returns>The number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" />.</returns>
/// <returns>The number of elements contained in the <see cref="HeaderDictionary" />.</returns>
public int Count
{
get
@ -99,10 +99,10 @@ namespace Microsoft.AspNetCore.Http.Internal
}
/// <summary>
/// Determines whether the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" /> contains a specific key.
/// Determines whether the <see cref="HeaderDictionary" /> contains a specific key.
/// </summary>
/// <param name="key">The key.</param>
/// <returns>true if the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" /> contains a specific key; otherwise, false.</returns>
/// <returns>true if the <see cref="HeaderDictionary" /> contains a specific key; otherwise, false.</returns>
public bool ContainsKey(string key)
{
if (Store == null)
@ -117,7 +117,7 @@ namespace Microsoft.AspNetCore.Http.Internal
/// </summary>
/// <param name="key">The header name.</param>
/// <param name="value">The value.</param>
/// <returns>true if the <see cref="T:Microsoft.AspNetCore.Http.Internal.HeaderDictionary" /> contains the key; otherwise, false.</returns>
/// <returns>true if the <see cref="HeaderDictionary" /> contains the key; otherwise, false.</returns>
public bool TryGetValue(string key, out StringValues value)
{
if (Store == null)
@ -131,7 +131,7 @@ namespace Microsoft.AspNetCore.Http.Internal
/// <summary>
/// Returns an enumerator that iterates through a collection.
/// </summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.</returns>
/// <returns>An <see cref="Enumerator" /> object that can be used to iterate through the collection.</returns>
public Enumerator GetEnumerator()
{
if (Store == null || Store.Count == 0)
@ -145,7 +145,7 @@ namespace Microsoft.AspNetCore.Http.Internal
/// <summary>
/// Returns an enumerator that iterates through a collection.
/// </summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.</returns>
/// <returns>An <see cref="IEnumerator{T}" /> object that can be used to iterate through the collection.</returns>
IEnumerator<KeyValuePair<string, StringValues>> IEnumerable<KeyValuePair<string, StringValues>>.GetEnumerator()
{
if (Store == null || Store.Count == 0)
@ -159,7 +159,7 @@ namespace Microsoft.AspNetCore.Http.Internal
/// <summary>
/// Returns an enumerator that iterates through a collection.
/// </summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.</returns>
/// <returns>An <see cref="IEnumerator" /> object that can be used to iterate through the collection.</returns>
IEnumerator IEnumerable.GetEnumerator()
{
if (Store == null || Store.Count == 0)

View File

@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Http.Internal
private static readonly string[] EmptyKeys = Array.Empty<string>();
#else
private static readonly string[] EmptyKeys = new string[0];
#endif
#endif
private static readonly Enumerator EmptyEnumerator = new Enumerator();
// Pre-box
private static readonly IEnumerator<KeyValuePair<string, string>> EmptyIEnumeratorType = EmptyEnumerator;
@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.Http.Internal
return null;
}
}
public static RequestCookieCollection Parse(IList<string> values)
{
if (values.Count == 0)
@ -135,7 +135,7 @@ namespace Microsoft.AspNetCore.Http.Internal
/// <summary>
/// Returns an struct enumerator that iterates through a collection without boxing.
/// </summary>
/// <returns>An <see cref="T:Microsoft.AspNetCore.Http.Internal.RequestCookies.Enumerator" /> object that can be used to iterate through the collection.</returns>
/// <returns>An <see cref="Enumerator" /> object that can be used to iterate through the collection.</returns>
public Enumerator GetEnumerator()
{
if (Store == null || Store.Count == 0)
@ -150,7 +150,7 @@ namespace Microsoft.AspNetCore.Http.Internal
/// <summary>
/// Returns an enumerator that iterates through a collection, boxes in non-empty path.
/// </summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.</returns>
/// <returns>An <see cref="IEnumerator{T}" /> object that can be used to iterate through the collection.</returns>
IEnumerator<KeyValuePair<string, string>> IEnumerable<KeyValuePair<string, string>>.GetEnumerator()
{
if (Store == null || Store.Count == 0)
@ -159,13 +159,13 @@ namespace Microsoft.AspNetCore.Http.Internal
return EmptyIEnumeratorType;
}
// Boxed Enumerator
return GetEnumerator();
return GetEnumerator();
}
/// <summary>
/// Returns an enumerator that iterates through a collection, boxes in non-empty path.
/// </summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.</returns>
/// <returns>An <see cref="IEnumerator" /> object that can be used to iterate through the collection.</returns>
IEnumerator IEnumerable.GetEnumerator()
{
if (Store == null || Store.Count == 0)
@ -176,7 +176,7 @@ namespace Microsoft.AspNetCore.Http.Internal
// Boxed Enumerator
return GetEnumerator();
}
public struct Enumerator : IEnumerator<KeyValuePair<string, string>>
{
// Do NOT make this readonly, or MoveNext will not work

View File

@ -17,8 +17,6 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Features.Authentication;
using Microsoft.AspNetCore.Http.Features.Authentication.Internal;
using Microsoft.AspNetCore.Http.Features.Internal;
namespace Microsoft.AspNetCore.Owin
{

View File

@ -7,7 +7,6 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder.Internal;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.AspNetCore.Owin;
namespace Microsoft.AspNetCore.Builder

View File

@ -3,7 +3,6 @@
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Internal;
using Xunit;
namespace Microsoft.AspNetCore.Http

View File

@ -5,7 +5,6 @@ using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder.Internal;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Internal;
using Xunit;
namespace Microsoft.AspNetCore.Builder.Extensions

View File

@ -2,11 +2,9 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder.Internal;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Internal;
using Xunit;
namespace Microsoft.AspNetCore.Builder.Extensions

View File

@ -6,7 +6,6 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Builder.Internal;
using Microsoft.AspNetCore.Http.Abstractions;
using Microsoft.AspNetCore.Http.Internal;
using Xunit;
namespace Microsoft.AspNetCore.Http

View File

@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.Net.Http.Headers;
using Xunit;

View File

@ -2,12 +2,9 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.Extensions.Primitives;
using Xunit;
namespace Microsoft.AspNetCore.Http.Extensions

View File

@ -1,11 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information.
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Internal;
using Xunit;
namespace Microsoft.AspNetCore.Http.Extensions.Tests

View File

@ -1,7 +1,6 @@
// 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 Microsoft.AspNetCore.Http.Internal;
using Xunit;
namespace Microsoft.AspNetCore.Http.Extensions

View File

@ -4,10 +4,7 @@
using System;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Features.Authentication;
using Microsoft.AspNetCore.Http.Features.Authentication.Internal;
using Microsoft.AspNetCore.Http.Internal;
using Xunit;
namespace Microsoft.AspNetCore.Http.Authentication.Internal

View File

@ -9,10 +9,9 @@ using System.Reflection;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Features.Internal;
using Xunit;
namespace Microsoft.AspNetCore.Http.Internal
namespace Microsoft.AspNetCore.Http
{
public class DefaultHttpContextTests
{

View File

@ -4,9 +4,8 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features.Internal;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
public class FakeResponseFeature : HttpResponseFeature
{

View File

@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Http.Internal;
using Microsoft.AspNetCore.WebUtilities;
using Xunit;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
public class FormFeatureTests
{

View File

@ -1,10 +1,9 @@
// 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 Microsoft.AspNetCore.Http.Features.Internal;
using Xunit;
namespace Microsoft.AspNetCore.Http.Tests
namespace Microsoft.AspNetCore.Http.Features
{
public class HttpRequestIdentifierFeatureTests
{

View File

@ -6,7 +6,7 @@ using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
public class NonSeekableReadStream : Stream
{

View File

@ -3,7 +3,7 @@
using Xunit;
namespace Microsoft.AspNetCore.Http.Features.Internal
namespace Microsoft.AspNetCore.Http.Features
{
public class QueryFeatureTests
{

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
using Microsoft.Extensions.Primitives;
using Xunit;
namespace Microsoft.AspNetCore.Http.Internal
namespace Microsoft.AspNetCore.Http
{
public class HeaderDictionaryTests
{

View File

@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.ObjectPool;
using Xunit;
namespace Microsoft.AspNetCore.Http.Internal
namespace Microsoft.AspNetCore.Http
{
public class HttpContextFactoryTests
{

View File

@ -1,7 +1,7 @@
// 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 Microsoft.AspNetCore.Http.Internal;
using Microsoft.AspNetCore.Http;
using Xunit;
namespace Microsoft.AspNetCore.Builder.Internal

View File

@ -7,7 +7,6 @@ using System.Linq;
using System.Security.Claims;
using System.Threading;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Internal;
using Xunit;
namespace Microsoft.AspNetCore.Owin

View File

@ -8,7 +8,6 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Builder.Internal;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.Extensions.DependencyInjection;
using Xunit;