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`
This commit is contained in:
Doug Bunting 2016-03-21 08:47:12 -07:00
parent 131db6c41e
commit 6f24508a33
23 changed files with 25 additions and 27 deletions

View File

@ -29,10 +29,8 @@
}, },
"netstandard1.3": { "netstandard1.3": {
"dependencies": { "dependencies": {
"System.ComponentModel": "4.0.1-*",
"System.Globalization.Extensions": "4.0.1-*", "System.Globalization.Extensions": "4.0.1-*",
"System.Linq.Expressions": "4.0.11-*", "System.Linq.Expressions": "4.0.11-*",
"System.Net.WebSockets": "4.0.0-*",
"System.Reflection.TypeExtensions": "4.1.0-*", "System.Reflection.TypeExtensions": "4.1.0-*",
"System.Runtime.InteropServices": "4.1.0-*" "System.Runtime.InteropServices": "4.1.0-*"
}, },

View File

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Text; using System.Text;
using Microsoft.AspNetCore.Http.Features;
namespace Microsoft.AspNetCore.Http namespace Microsoft.AspNetCore.Http
{ {

View File

@ -18,9 +18,9 @@ namespace Microsoft.AspNetCore.Http
/// The number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />. /// The number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />.
/// </returns> /// </returns>
int Count { get; } int Count { get; }
/// <summary> /// <summary>
/// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the /// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the
/// <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />. /// <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" />.
/// </summary> /// </summary>
/// <returns> /// <returns>
@ -79,7 +79,7 @@ namespace Microsoft.AspNetCore.Http
/// key is null. /// key is null.
/// </exception> /// </exception>
/// <remarks> /// <remarks>
/// <see cref="T:Microsoft.AspNetCore.Http.IFormCollection" /> has a different indexer contract than /// <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="T:System.Collections.Generic.IDictionary`2" />, as it will return StringValues.Empty for missing entries
/// rather than throwing an Exception. /// rather than throwing an Exception.
/// </remarks> /// </remarks>

View File

@ -4,7 +4,7 @@
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Http.Features.Internal namespace Microsoft.AspNetCore.Http.Features
{ {
public interface IFormFeature public interface IFormFeature
{ {

View File

@ -3,7 +3,7 @@
using System.Collections.Generic; using System.Collections.Generic;
namespace Microsoft.AspNetCore.Http.Features.Internal namespace Microsoft.AspNetCore.Http.Features
{ {
public interface IItemsFeature public interface IItemsFeature
{ {

View File

@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Http
int Count { get; } int Count { get; }
/// <summary> /// <summary>
/// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the /// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the
/// <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" />. /// <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" />.
/// </summary> /// </summary>
/// <returns> /// <returns>
@ -73,13 +73,14 @@ namespace Microsoft.AspNetCore.Http
/// The key of the value to get. /// The key of the value to get.
/// </param> /// </param>
/// <returns> /// <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 <see cref="T:Microsoft.Extensions.Primitives.StringValues" />.
/// Empty if the key is not present.
/// </returns> /// </returns>
/// <exception cref="T:System.ArgumentNullException"> /// <exception cref="T:System.ArgumentNullException">
/// key is null. /// key is null.
/// </exception> /// </exception>
/// <remarks> /// <remarks>
/// <see cref="T:Microsoft.AspNetCore.Http.IQueryCollection" /> has a different indexer contract than /// <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="T:System.Collections.Generic.IDictionary`2" />, as it will return StringValues.Empty for missing entries
/// rather than throwing an Exception. /// rather than throwing an Exception.
/// </remarks> /// </remarks>

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // 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. // 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
{ {
public interface IQueryFeature public interface IQueryFeature
{ {

View File

@ -17,9 +17,9 @@ namespace Microsoft.AspNetCore.Http
/// The number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />. /// The number of elements contained in the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
/// </returns> /// </returns>
int Count { get; } int Count { get; }
/// <summary> /// <summary>
/// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the /// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the
/// <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />. /// <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
/// </summary> /// </summary>
/// <returns> /// <returns>
@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Http
/// that implements <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />. /// that implements <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" />.
/// </returns> /// </returns>
ICollection<string> Keys { get; } ICollection<string> Keys { get; }
/// <summary> /// <summary>
/// Determines whether the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" /> contains an element /// Determines whether the <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" /> contains an element
/// with the specified key. /// with the specified key.
@ -78,7 +78,7 @@ namespace Microsoft.AspNetCore.Http
/// key is null. /// key is null.
/// </exception> /// </exception>
/// <remarks> /// <remarks>
/// <see cref="T:Microsoft.AspNetCore.Http.IRequestCookieCollection" /> has a different indexer contract than /// <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="T:System.Collections.Generic.IDictionary`2" />, as it will return String.Empty for missing entries
/// rather than throwing an Exception. /// rather than throwing an Exception.
/// </remarks> /// </remarks>

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // 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. // 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
{ {
public interface IRequestCookiesFeature public interface IRequestCookiesFeature
{ {

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // 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. // 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
{ {
public interface IResponseCookiesFeature public interface IResponseCookiesFeature
{ {

View File

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

View File

@ -4,7 +4,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Http.Features namespace Microsoft.AspNetCore.Http
{ {
public interface ISession public interface ISession
{ {

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.AspNetCore.Http.Features namespace Microsoft.AspNetCore.Http
{ {
public class WebSocketAcceptContext public class WebSocketAcceptContext
{ {

View File

@ -21,6 +21,7 @@
"netstandard1.3": { "netstandard1.3": {
"dependencies": { "dependencies": {
"System.Collections": "4.0.11-*", "System.Collections": "4.0.11-*",
"System.ComponentModel": "4.0.1-*",
"System.Linq": "4.1.0-*", "System.Linq": "4.1.0-*",
"System.Net.Primitives": "4.0.11-*", "System.Net.Primitives": "4.0.11-*",
"System.Net.WebSockets": "4.0.0-*", "System.Net.WebSockets": "4.0.0-*",

View File

@ -16,9 +16,9 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Features.Internal;
using Microsoft.AspNetCore.Http.Features.Authentication; using Microsoft.AspNetCore.Http.Features.Authentication;
using Microsoft.AspNetCore.Http.Features.Authentication.Internal; using Microsoft.AspNetCore.Http.Features.Authentication.Internal;
using Microsoft.AspNetCore.Http.Features.Internal;
namespace Microsoft.AspNetCore.Owin namespace Microsoft.AspNetCore.Owin
{ {

View File

@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.WebSockets; using System.Net.WebSockets;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http;
namespace Microsoft.AspNetCore.Owin namespace Microsoft.AspNetCore.Owin
{ {

View File

@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http;
namespace Microsoft.AspNetCore.Owin namespace Microsoft.AspNetCore.Owin
{ {

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Net.WebSockets; using System.Net.WebSockets;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http;
namespace Microsoft.AspNetCore.Owin namespace Microsoft.AspNetCore.Owin
{ {

View File

@ -8,7 +8,6 @@ using System.Net.WebSockets;
using System.Reflection; using System.Reflection;
using System.Security.Claims; using System.Security.Claims;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Authentication.Internal;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Features.Internal; using Microsoft.AspNetCore.Http.Features.Internal;
using Xunit; using Xunit;
@ -204,7 +203,7 @@ namespace Microsoft.AspNetCore.Http.Internal
var field = type var field = type
.GetFields(BindingFlags.NonPublic | BindingFlags.Instance) .GetFields(BindingFlags.NonPublic | BindingFlags.Instance)
.Single(f => .Single(f =>
f.FieldType.GetTypeInfo().IsGenericType && f.FieldType.GetTypeInfo().IsGenericType &&
f.FieldType.GetGenericTypeDefinition() == typeof(FeatureReferences<>)); f.FieldType.GetGenericTypeDefinition() == typeof(FeatureReferences<>));