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

Commit 6f24508

Browse files
committed
Move remaining feature interfaces into Microsoft.AspNetCore.Http.Features package and namespace
- #590, also related to #561 - move feature interfaces from `Microsoft.AspNetCore.Http` package - move required classes from `Microsoft.AspNetCore.Http.Abstractions` package - move `ISession` and `WebSocketAcceptContext` to `Microsoft.AspNetCore.Http` namespace (#590) nit: remove transient dependencies listed in `Microsoft.AspNetCore.Http.Abstractions`'s `project.json`
1 parent 131db6c commit 6f24508

23 files changed

+25
-27
lines changed

src/Microsoft.AspNetCore.Http.Abstractions/project.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929
},
3030
"netstandard1.3": {
3131
"dependencies": {
32-
"System.ComponentModel": "4.0.1-*",
3332
"System.Globalization.Extensions": "4.0.1-*",
3433
"System.Linq.Expressions": "4.0.11-*",
35-
"System.Net.WebSockets": "4.0.0-*",
3634
"System.Reflection.TypeExtensions": "4.1.0-*",
3735
"System.Runtime.InteropServices": "4.1.0-*"
3836
},

src/Microsoft.AspNetCore.Http.Extensions/SessionExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System.Text;
5-
using Microsoft.AspNetCore.Http.Features;
65

76
namespace Microsoft.AspNetCore.Http
87
{

src/Microsoft.AspNetCore.Http.Abstractions/IFormCollection.cs renamed to src/Microsoft.AspNetCore.Http.Features/IFormCollection.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ public interface IFormCollection : IEnumerable<KeyValuePair<string, StringValues
1818
/// The number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />.
1919
/// </returns>
2020
int Count { get; }
21-
21+
2222
/// <summary>
23-
/// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the
23+
/// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the
2424
/// <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />.
2525
/// </summary>
2626
/// <returns>
@@ -79,7 +79,7 @@ public interface IFormCollection : IEnumerable<KeyValuePair<string, StringValues
7979
/// key is null.
8080
/// </exception>
8181
/// <remarks>
82-
/// <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" /> has a different indexer contract than
82+
/// <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" /> has a different indexer contract than
8383
/// <see cref="T:System.Collections.Generic.IDictionary`2" />, as it will return StringValues.Empty for missing entries
8484
/// rather than throwing an Exception.
8585
/// </remarks>

src/Microsoft.AspNetCore.Http/Features/IFormFeature.cs renamed to src/Microsoft.AspNetCore.Http.Features/IFormFeature.cs

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

7-
namespace Microsoft.AspNetCore.Http.Features.Internal
7+
namespace Microsoft.AspNetCore.Http.Features
88
{
99
public interface IFormFeature
1010
{

src/Microsoft.AspNetCore.Http/Features/IItemsFeature.cs renamed to src/Microsoft.AspNetCore.Http.Features/IItemsFeature.cs

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

44
using System.Collections.Generic;
55

6-
namespace Microsoft.AspNetCore.Http.Features.Internal
6+
namespace Microsoft.AspNetCore.Http.Features
77
{
88
public interface IItemsFeature
99
{

src/Microsoft.AspNetCore.Http.Abstractions/IQueryCollection.cs renamed to src/Microsoft.AspNetCore.Http.Features/IQueryCollection.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public interface IQueryCollection : IEnumerable<KeyValuePair<string, StringValue
2020
int Count { get; }
2121

2222
/// <summary>
23-
/// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the
23+
/// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the
2424
/// <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" />.
2525
/// </summary>
2626
/// <returns>
@@ -73,13 +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" />.Empty if the key is not present.
76+
/// The element with the specified key, or <see cref="T:Microsoft.Extensions.Primitives.StringValues" />.
77+
/// Empty if the key is not present.
7778
/// </returns>
7879
/// <exception cref="T:System.ArgumentNullException">
7980
/// key is null.
8081
/// </exception>
8182
/// <remarks>
82-
/// <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" /> has a different indexer contract than
83+
/// <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" /> has a different indexer contract than
8384
/// <see cref="T:System.Collections.Generic.IDictionary`2" />, as it will return StringValues.Empty for missing entries
8485
/// rather than throwing an Exception.
8586
/// </remarks>

src/Microsoft.AspNetCore.Http/Features/IQueryFeature.cs renamed to src/Microsoft.AspNetCore.Http.Features/IQueryFeature.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
public interface IQueryFeature
77
{

src/Microsoft.AspNetCore.Http.Abstractions/IRequestCookieCollection.cs renamed to src/Microsoft.AspNetCore.Http.Features/IRequestCookieCollection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ public interface IRequestCookieCollection : IEnumerable<KeyValuePair<string, str
1717
/// The number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
1818
/// </returns>
1919
int Count { get; }
20-
20+
2121
/// <summary>
22-
/// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the
22+
/// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the
2323
/// <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
2424
/// </summary>
2525
/// <returns>
2626
/// An <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the object
2727
/// that implements <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
2828
/// </returns>
2929
ICollection<string> Keys { get; }
30-
30+
3131
/// <summary>
3232
/// Determines whether the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" /> contains an element
3333
/// with the specified key.
@@ -78,7 +78,7 @@ public interface IRequestCookieCollection : IEnumerable<KeyValuePair<string, str
7878
/// key is null.
7979
/// </exception>
8080
/// <remarks>
81-
/// <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" /> has a different indexer contract than
81+
/// <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" /> has a different indexer contract than
8282
/// <see cref="T:System.Collections.Generic.IDictionary`2" />, as it will return String.Empty for missing entries
8383
/// rather than throwing an Exception.
8484
/// </remarks>

src/Microsoft.AspNetCore.Http/Features/IRequestCookiesFeature.cs renamed to src/Microsoft.AspNetCore.Http.Features/IRequestCookiesFeature.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
public interface IRequestCookiesFeature
77
{

src/Microsoft.AspNetCore.Http/Features/IResponseCookiesFeature.cs renamed to src/Microsoft.AspNetCore.Http.Features/IResponseCookiesFeature.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
public interface IResponseCookiesFeature
77
{

src/Microsoft.AspNetCore.Http/Features/IServiceProvidersFeature.cs renamed to src/Microsoft.AspNetCore.Http.Features/IServiceProvidersFeature.cs

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

44
using System;
55

6-
namespace Microsoft.AspNetCore.Http.Features.Internal
6+
namespace Microsoft.AspNetCore.Http.Features
77
{
88
public interface IServiceProvidersFeature
99
{

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

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

7-
namespace Microsoft.AspNetCore.Http.Features
7+
namespace Microsoft.AspNetCore.Http
88
{
99
public interface ISession
1010
{

src/Microsoft.AspNetCore.Http.Features/WebSocketAcceptContext.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
4+
namespace Microsoft.AspNetCore.Http
55
{
66
public class WebSocketAcceptContext
77
{

src/Microsoft.AspNetCore.Http.Features/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"netstandard1.3": {
2222
"dependencies": {
2323
"System.Collections": "4.0.11-*",
24+
"System.ComponentModel": "4.0.1-*",
2425
"System.Linq": "4.1.0-*",
2526
"System.Net.Primitives": "4.0.11-*",
2627
"System.Net.WebSockets": "4.0.0-*",

src/Microsoft.AspNetCore.Owin/OwinEnvironment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
using System.Threading.Tasks;
1717
using Microsoft.AspNetCore.Http;
1818
using Microsoft.AspNetCore.Http.Features;
19-
using Microsoft.AspNetCore.Http.Features.Internal;
2019
using Microsoft.AspNetCore.Http.Features.Authentication;
2120
using Microsoft.AspNetCore.Http.Features.Authentication.Internal;
21+
using Microsoft.AspNetCore.Http.Features.Internal;
2222

2323
namespace Microsoft.AspNetCore.Owin
2424
{

src/Microsoft.AspNetCore.Owin/WebSockets/OwinWebSocketAcceptAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Collections.Generic;
66
using System.Net.WebSockets;
77
using System.Threading.Tasks;
8-
using Microsoft.AspNetCore.Http.Features;
8+
using Microsoft.AspNetCore.Http;
99

1010
namespace Microsoft.AspNetCore.Owin
1111
{

src/Microsoft.AspNetCore.Owin/WebSockets/OwinWebSocketAcceptContext.cs

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

44
using System.Collections.Generic;
5-
using Microsoft.AspNetCore.Http.Features;
5+
using Microsoft.AspNetCore.Http;
66

77
namespace Microsoft.AspNetCore.Owin
88
{

src/Microsoft.AspNetCore.Owin/WebSockets/WebSocketAcceptAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System.Net.WebSockets;
77
using System.Threading;
88
using System.Threading.Tasks;
9-
using Microsoft.AspNetCore.Http.Features;
9+
using Microsoft.AspNetCore.Http;
1010

1111
namespace Microsoft.AspNetCore.Owin
1212
{

test/Microsoft.AspNetCore.Http.Tests/DefaultHttpContextTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using System.Reflection;
99
using System.Security.Claims;
1010
using System.Threading.Tasks;
11-
using Microsoft.AspNetCore.Http.Authentication.Internal;
1211
using Microsoft.AspNetCore.Http.Features;
1312
using Microsoft.AspNetCore.Http.Features.Internal;
1413
using Xunit;
@@ -204,7 +203,7 @@ void TestCachedFeaturesAreNull(object value, IFeatureCollection features)
204203

205204
var field = type
206205
.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)
207-
.Single(f =>
206+
.Single(f =>
208207
f.FieldType.GetTypeInfo().IsGenericType &&
209208
f.FieldType.GetGenericTypeDefinition() == typeof(FeatureReferences<>));
210209

0 commit comments

Comments
 (0)