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

Commit 69849cc

Browse files
committed
#311 Move UseMiddleware to Http.Abstractions.
1 parent 83a8fd1 commit 69849cc

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Microsoft.AspNet.Http.Extensions/UseMiddlewareExtensions.cs renamed to src/Microsoft.AspNet.Http.Abstractions/Extensions/UseMiddlewareExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
using System;
55
using System.Linq;
66
using System.Reflection;
7-
using Microsoft.Framework.DependencyInjection;
87
using System.Threading.Tasks;
98
using Microsoft.AspNet.Http;
9+
using Microsoft.Framework.Internal;
1010

1111
namespace Microsoft.AspNet.Builder
1212
{
@@ -27,7 +27,7 @@ public static IApplicationBuilder UseMiddleware(this IApplicationBuilder builder
2727
var parameters = methodinfo.GetParameters();
2828
if (parameters[0].ParameterType != typeof(HttpContext))
2929
{
30-
throw new Exception("TODO: Middleware Invoke method must take first argument of HttpContext");
30+
throw new Exception("Middleware Invoke method must take first argument of HttpContext");
3131
}
3232
if (parameters.Length == 1)
3333
{
@@ -38,7 +38,7 @@ public static IApplicationBuilder UseMiddleware(this IApplicationBuilder builder
3838
var serviceProvider = context.RequestServices ?? context.ApplicationServices ?? applicationServices;
3939
if (serviceProvider == null)
4040
{
41-
throw new Exception("TODO: IServiceProvider is not available");
41+
throw new Exception("IServiceProvider is not available");
4242
}
4343
var arguments = new object[parameters.Length];
4444
arguments[0] = context;
@@ -48,7 +48,7 @@ public static IApplicationBuilder UseMiddleware(this IApplicationBuilder builder
4848
arguments[index] = serviceProvider.GetService(serviceType);
4949
if (arguments[index] == null)
5050
{
51-
throw new Exception(string.Format("TODO: No service for type '{0}' has been registered.", serviceType));
51+
throw new Exception(string.Format("No service for type '{0}' has been registered.", serviceType));
5252
}
5353
}
5454
return (Task)methodinfo.Invoke(instance, arguments);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"version": "1.0.0-*",
33
"description": "ASP.NET 5 HTTP object model. HttpContext and family.",
44
"dependencies": {
5+
"Microsoft.Framework.ActivatorUtilities.Sources": { "type": "build", "version": "1.0.0-*" },
56
"Microsoft.Framework.NotNullAttribute.Sources": { "type": "build", "version": "1.0.0-*" },
67
"Microsoft.Framework.WebEncoders.Core": "1.0.0-*"
78
},
@@ -16,6 +17,7 @@
1617
"System.Linq": "4.0.0-beta-*",
1718
"System.Net.Primitives": "4.0.10-beta-*",
1819
"System.Net.WebSockets" : "4.0.0-beta-*",
20+
"System.Reflection.TypeExtensions": "4.0.0-beta-*",
1921
"System.Runtime": "4.0.20-beta-*",
2022
"System.Runtime.InteropServices": "4.0.20-beta-*",
2123
"System.Security.Cryptography.X509Certificates": "4.0.0-beta-*",

src/Microsoft.AspNet.Http.Extensions/project.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"dependencies": {
55
"Microsoft.AspNet.Http.Abstractions": "1.0.0-*",
66
"Microsoft.AspNet.Http.Features": "1.0.0-*",
7-
"Microsoft.Framework.DependencyInjection.Abstractions": "1.0.0-*",
87
"Microsoft.Framework.NotNullAttribute.Sources": { "type": "build", "version": "1.0.0-*" },
98
"Microsoft.Framework.WebEncoders.Core": "1.0.0-*",
109
"Microsoft.Net.Http.Headers": "1.0.0-*"
@@ -15,7 +14,6 @@
1514
"dnxcore50": {
1615
"dependencies": {
1716
"System.IO.FileSystem": "4.0.0-beta-*",
18-
"System.Reflection.TypeExtensions": "4.0.0-beta-*",
1917
"System.Runtime": "4.0.20-beta-*"
2018
}
2119
}

0 commit comments

Comments
 (0)