Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit 23e9f90

Browse files
committed
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
1 parent bd60507 commit 23e9f90

File tree

66 files changed

+128
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+128
-175
lines changed

samples/SampleApp/PooledHttpContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class PooledHttpContext : DefaultHttpContext
1212
DefaultHttpRequest _pooledHttpRequest;
1313
DefaultHttpResponse _pooledHttpResponse;
1414

15-
public PooledHttpContext(IFeatureCollection featureCollection) :
15+
public PooledHttpContext(IFeatureCollection featureCollection) :
1616
base(featureCollection)
1717
{
1818
}

samples/SampleApp/PooledHttpContextFactory.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System.Text;
77
using Microsoft.AspNetCore.Http;
88
using Microsoft.AspNetCore.Http.Features;
9-
using Microsoft.AspNetCore.Http.Features.Internal;
109
using Microsoft.Extensions.ObjectPool;
1110

1211
namespace SampleApp

src/Microsoft.AspNetCore.Http.Abstractions/Internal/HeaderSegment.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System;
55
using Microsoft.Extensions.Primitives;
66

7-
87
namespace Microsoft.AspNetCore.Http.Internal
98
{
109
internal struct HeaderSegment : IEquatable<HeaderSegment>
@@ -13,7 +12,7 @@ internal struct HeaderSegment : IEquatable<HeaderSegment>
1312
private readonly StringSegment _data;
1413

1514
// <summary>
16-
// Initializes a new instance of the <see cref="T:System.Object"/> class.
15+
// Initializes a new instance of the <see cref="HeaderSegment/> structure.
1716
// </summary>
1817
public HeaderSegment(StringSegment formatting, StringSegment data)
1918
{

src/Microsoft.AspNetCore.Http.Features/IFormCollection.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,35 @@ namespace Microsoft.AspNetCore.Http
1212
public interface IFormCollection : IEnumerable<KeyValuePair<string, StringValues>>
1313
{
1414
/// <summary>
15-
/// Gets the number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />.
15+
/// Gets the number of elements contained in the <see cref="IFormCollection" />.
1616
/// </summary>
1717
/// <returns>
18-
/// The number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />.
18+
/// The number of elements contained in the <see cref="IFormCollection" />.
1919
/// </returns>
2020
int Count { get; }
2121

2222
/// <summary>
23-
/// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the
24-
/// <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />.
23+
/// Gets an <see cref="ICollection{T}" /> containing the keys of the
24+
/// <see cref="IFormCollection" />.
2525
/// </summary>
2626
/// <returns>
27-
/// An <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the object
28-
/// that implements <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />.
27+
/// An <see cref="ICollection{T}" /> containing the keys of the object
28+
/// that implements <see cref="IFormCollection" />.
2929
/// </returns>
3030
ICollection<string> Keys { get; }
3131

3232
/// <summary>
33-
/// Determines whether the <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" /> contains an element
33+
/// Determines whether the <see cref="IFormCollection" /> contains an element
3434
/// with the specified key.
3535
/// </summary>
3636
/// <param name="key">
37-
/// The key to locate in the <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />.
37+
/// The key to locate in the <see cref="IFormCollection" />.
3838
/// </param>
3939
/// <returns>
40-
/// true if the <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" /> contains an element with
40+
/// true if the <see cref="IFormCollection" /> contains an element with
4141
/// the key; otherwise, false.
4242
/// </returns>
43-
/// <exception cref="T:System.ArgumentNullException">
43+
/// <exception cref="System.ArgumentNullException">
4444
/// key is null.
4545
/// </exception>
4646
bool ContainsKey(string key);
@@ -58,10 +58,10 @@ public interface IFormCollection : IEnumerable<KeyValuePair<string, StringValues
5858
/// This parameter is passed uninitialized.
5959
/// </param>
6060
/// <returns>
61-
/// true if the object that implements <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" /> contains
61+
/// true if the object that implements <see cref="IFormCollection" /> contains
6262
/// an element with the specified key; otherwise, false.
6363
/// </returns>
64-
/// <exception cref="T:System.ArgumentNullException">
64+
/// <exception cref="System.ArgumentNullException">
6565
/// key is null.
6666
/// </exception>
6767
bool TryGetValue(string key, out StringValues value);
@@ -73,14 +73,14 @@ public interface IFormCollection : IEnumerable<KeyValuePair<string, StringValues
7373
/// The key of the value to get.
7474
/// </param>
7575
/// <returns>
76-
/// The element with the specified key, or <see cref="T:Microsoft.Extensions.Primitives.StringValues" />.Empty if the key is not present.
76+
/// The element with the specified key, or <c>StringValues.Empty</c> if the key is not present.
7777
/// </returns>
78-
/// <exception cref="T:System.ArgumentNullException">
78+
/// <exception cref="System.ArgumentNullException">
7979
/// key is null.
8080
/// </exception>
8181
/// <remarks>
82-
/// <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" /> has a different indexer contract than
83-
/// <see cref="T:System.Collections.Generic.IDictionary`2" />, as it will return StringValues.Empty for missing entries
82+
/// <see cref="IFormCollection" /> has a different indexer contract than
83+
/// <see cref="IDictionary{TKey, TValue}" />, as it will return <c>StringValues.Empty</c> for missing entries
8484
/// rather than throwing an Exception.
8585
/// </remarks>
8686
StringValues this[string key] { get; }

src/Microsoft.AspNetCore.Http.Features/IQueryCollection.cs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,35 @@ namespace Microsoft.AspNetCore.Http
1212
public interface IQueryCollection : IEnumerable<KeyValuePair<string, StringValues>>
1313
{
1414
/// <summary>
15-
/// Gets the number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" />.
15+
/// Gets the number of elements contained in the <see cref="IQueryCollection" />.
1616
/// </summary>
1717
/// <returns>
18-
/// The number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" />.
18+
/// The number of elements contained in the <see cref="IQueryCollection" />.
1919
/// </returns>
2020
int Count { get; }
2121

2222
/// <summary>
23-
/// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the
24-
/// <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" />.
23+
/// Gets an <see cref="ICollection{T}" /> containing the keys of the
24+
/// <see cref="IQueryCollection" />.
2525
/// </summary>
2626
/// <returns>
27-
/// An <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the object
28-
/// that implements <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" />.
27+
/// An <see cref="ICollection{T}" /> containing the keys of the object
28+
/// that implements <see cref="IQueryCollection" />.
2929
/// </returns>
3030
ICollection<string> Keys { get; }
3131

3232
/// <summary>
33-
/// Determines whether the <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" /> contains an element
33+
/// Determines whether the <see cref="IQueryCollection" /> contains an element
3434
/// with the specified key.
3535
/// </summary>
3636
/// <param name="key">
37-
/// The key to locate in the <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" />.
37+
/// The key to locate in the <see cref="IQueryCollection" />.
3838
/// </param>
3939
/// <returns>
40-
/// true if the <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" /> contains an element with
40+
/// true if the <see cref="IQueryCollection" /> contains an element with
4141
/// the key; otherwise, false.
4242
/// </returns>
43-
/// <exception cref="T:System.ArgumentNullException">
43+
/// <exception cref="System.ArgumentNullException">
4444
/// key is null.
4545
/// </exception>
4646
bool ContainsKey(string key);
@@ -58,10 +58,10 @@ public interface IQueryCollection : IEnumerable<KeyValuePair<string, StringValue
5858
/// This parameter is passed uninitialized.
5959
/// </param>
6060
/// <returns>
61-
/// true if the object that implements <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" /> contains
61+
/// true if the object that implements <see cref="IQueryCollection" /> contains
6262
/// an element with the specified key; otherwise, false.
6363
/// </returns>
64-
/// <exception cref="T:System.ArgumentNullException">
64+
/// <exception cref="System.ArgumentNullException">
6565
/// key is null.
6666
/// </exception>
6767
bool TryGetValue(string key, out StringValues value);
@@ -73,15 +73,14 @@ public interface IQueryCollection : IEnumerable<KeyValuePair<string, StringValue
7373
/// The key of the value to get.
7474
/// </param>
7575
/// <returns>
76-
/// The element with the specified key, or <see cref="T:Microsoft.Extensions.Primitives.StringValues" />.
77-
/// Empty if the key is not present.
76+
/// The element with the specified key, or <c>StringValues.Empty</c> if the key is not present.
7877
/// </returns>
79-
/// <exception cref="T:System.ArgumentNullException">
78+
/// <exception cref="System.ArgumentNullException">
8079
/// key is null.
8180
/// </exception>
8281
/// <remarks>
83-
/// <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" /> has a different indexer contract than
84-
/// <see cref="T:System.Collections.Generic.IDictionary`2" />, as it will return StringValues.Empty for missing entries
82+
/// <see cref="IQueryCollection" /> has a different indexer contract than
83+
/// <see cref="IDictionary{TKey, TValue}" />, as it will return <c>StringValues.Empty</c> for missing entries
8584
/// rather than throwing an Exception.
8685
/// </remarks>
8786
StringValues this[string key] { get; }

src/Microsoft.AspNetCore.Http.Features/IRequestCookieCollection.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,35 @@ namespace Microsoft.AspNetCore.Http
1111
public interface IRequestCookieCollection : IEnumerable<KeyValuePair<string, string>>
1212
{
1313
/// <summary>
14-
/// Gets the number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
14+
/// Gets the number of elements contained in the <see cref="IRequestCookieCollection" />.
1515
/// </summary>
1616
/// <returns>
17-
/// The number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
17+
/// The number of elements contained in the <see cref="IRequestCookieCollection" />.
1818
/// </returns>
1919
int Count { get; }
2020

2121
/// <summary>
22-
/// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the
23-
/// <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
22+
/// Gets an <see cref="ICollection{T}" /> containing the keys of the
23+
/// <see cref="IRequestCookieCollection" />.
2424
/// </summary>
2525
/// <returns>
26-
/// An <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the object
27-
/// that implements <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
26+
/// An <see cref="ICollection{T}" /> containing the keys of the object
27+
/// that implements <see cref="IRequestCookieCollection" />.
2828
/// </returns>
2929
ICollection<string> Keys { get; }
3030

3131
/// <summary>
32-
/// Determines whether the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" /> contains an element
32+
/// Determines whether the <see cref="IRequestCookieCollection" /> contains an element
3333
/// with the specified key.
3434
/// </summary>
3535
/// <param name="key">
36-
/// The key to locate in the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
36+
/// The key to locate in the <see cref="IRequestCookieCollection" />.
3737
/// </param>
3838
/// <returns>
39-
/// true if the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" /> contains an element with
39+
/// true if the <see cref="IRequestCookieCollection" /> contains an element with
4040
/// the key; otherwise, false.
4141
/// </returns>
42-
/// <exception cref="T:System.ArgumentNullException">
42+
/// <exception cref="System.ArgumentNullException">
4343
/// key is null.
4444
/// </exception>
4545
bool ContainsKey(string key);
@@ -57,10 +57,10 @@ public interface IRequestCookieCollection : IEnumerable<KeyValuePair<string, str
5757
/// This parameter is passed uninitialized.
5858
/// </param>
5959
/// <returns>
60-
/// true if the object that implements <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" /> contains
60+
/// true if the object that implements <see cref="IRequestCookieCollection" /> contains
6161
/// an element with the specified key; otherwise, false.
6262
/// </returns>
63-
/// <exception cref="T:System.ArgumentNullException">
63+
/// <exception cref="System.ArgumentNullException">
6464
/// key is null.
6565
/// </exception>
6666
bool TryGetValue(string key, out string value);
@@ -72,14 +72,14 @@ public interface IRequestCookieCollection : IEnumerable<KeyValuePair<string, str
7272
/// The key of the value to get.
7373
/// </param>
7474
/// <returns>
75-
/// The element with the specified key, or <see cref="T:System.String" />.Empty if the key is not present.
75+
/// The element with the specified key, or <c>string.Empty</c> if the key is not present.
7676
/// </returns>
77-
/// <exception cref="T:System.ArgumentNullException">
77+
/// <exception cref="System.ArgumentNullException">
7878
/// key is null.
7979
/// </exception>
8080
/// <remarks>
81-
/// <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" /> has a different indexer contract than
82-
/// <see cref="T:System.Collections.Generic.IDictionary`2" />, as it will return String.Empty for missing entries
81+
/// <see cref="IRequestCookieCollection" /> has a different indexer contract than
82+
/// <see cref="IDictionary{TKey, TValue}" />, as it will return <c>string.Empty</c> for missing entries
8383
/// rather than throwing an Exception.
8484
/// </remarks>
8585
string this[string key] { get; }

src/Microsoft.AspNetCore.Http/Authentication/DefaultAuthenticationManager.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using System.Threading.Tasks;
99
using Microsoft.AspNetCore.Http.Features;
1010
using Microsoft.AspNetCore.Http.Features.Authentication;
11-
using Microsoft.AspNetCore.Http.Features.Authentication.Internal;
1211

1312
namespace Microsoft.AspNetCore.Http.Authentication.Internal
1413
{

src/Microsoft.AspNetCore.Http/DefaultHttpContext.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
using Microsoft.AspNetCore.Http.Authentication.Internal;
1010
using Microsoft.AspNetCore.Http.Features;
1111
using Microsoft.AspNetCore.Http.Features.Authentication;
12-
using Microsoft.AspNetCore.Http.Features.Authentication.Internal;
13-
using Microsoft.AspNetCore.Http.Features.Internal;
12+
using Microsoft.AspNetCore.Http.Internal;
1413

15-
namespace Microsoft.AspNetCore.Http.Internal
14+
namespace Microsoft.AspNetCore.Http
1615
{
1716
public class DefaultHttpContext : HttpContext
1817
{
@@ -72,7 +71,7 @@ public virtual void Uninitialize()
7271
_websockets = null;
7372
}
7473
}
75-
74+
7675
private IItemsFeature ItemsFeature =>
7776
_features.Fetch(ref _features.Cache.Items, f => new ItemsFeature());
7877

@@ -165,7 +164,7 @@ public override ISession Session
165164
}
166165
}
167166

168-
167+
169168

170169
public override void Abort()
171170
{

src/Microsoft.AspNetCore.Http/Features/Authentication/HttpAuthenticationFeature.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33

44
using System.Security.Claims;
55

6-
namespace Microsoft.AspNetCore.Http.Features.Authentication.Internal
6+
namespace Microsoft.AspNetCore.Http.Features.Authentication
77
{
88
public class HttpAuthenticationFeature : IHttpAuthenticationFeature
99
{
10-
public HttpAuthenticationFeature()
11-
{
12-
}
13-
1410
public ClaimsPrincipal User
1511
{
1612
get;

src/Microsoft.AspNetCore.Http/Features/DefaultSessionFeature.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4-
namespace Microsoft.AspNetCore.Http.Features.Internal
4+
namespace Microsoft.AspNetCore.Http.Features
55
{
66
/// <summary>
77
/// This type exists only for the purpose of unit testing where the user can directly set the

src/Microsoft.AspNetCore.Http/Features/FormFeature.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
using Microsoft.AspNetCore.WebUtilities;
1111
using Microsoft.Net.Http.Headers;
1212

13-
namespace Microsoft.AspNetCore.Http.Features.Internal
13+
namespace Microsoft.AspNetCore.Http.Features
1414
{
1515
public class FormFeature : IFormFeature
1616
{

src/Microsoft.AspNetCore.Http/Features/HttpConnectionFeature.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33

44
using System.Net;
55

6-
namespace Microsoft.AspNetCore.Http.Features.Internal
6+
namespace Microsoft.AspNetCore.Http.Features
77
{
88
public class HttpConnectionFeature : IHttpConnectionFeature
99
{
10-
public HttpConnectionFeature()
11-
{
12-
}
13-
1410
public string ConnectionId { get; set; }
1511

1612
public IPAddress LocalIpAddress { get; set; }

src/Microsoft.AspNetCore.Http/Features/HttpRequestFeature.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System.IO;
5-
using Microsoft.AspNetCore.Http.Internal;
65

7-
namespace Microsoft.AspNetCore.Http.Features.Internal
6+
namespace Microsoft.AspNetCore.Http.Features
87
{
98
public class HttpRequestFeature : IHttpRequestFeature
109
{

src/Microsoft.AspNetCore.Http/Features/HttpRequestIdentifierFeature.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System;
55
using System.Threading;
66

7-
namespace Microsoft.AspNetCore.Http.Features.Internal
7+
namespace Microsoft.AspNetCore.Http.Features
88
{
99
public class HttpRequestIdentifierFeature : IHttpRequestIdentifierFeature
1010
{

src/Microsoft.AspNetCore.Http/Features/HttpRequestLifetimeFeature.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using System.Threading;
55

6-
namespace Microsoft.AspNetCore.Http.Features.Internal
6+
namespace Microsoft.AspNetCore.Http.Features
77
{
88
public class HttpRequestLifetimeFeature : IHttpRequestLifetimeFeature
99
{

src/Microsoft.AspNetCore.Http/Features/HttpResponseFeature.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
using System;
55
using System.IO;
66
using System.Threading.Tasks;
7-
using Microsoft.AspNetCore.Http.Internal;
87

9-
namespace Microsoft.AspNetCore.Http.Features.Internal
8+
namespace Microsoft.AspNetCore.Http.Features
109
{
1110
public class HttpResponseFeature : IHttpResponseFeature
1211
{

0 commit comments

Comments
 (0)