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

Move UseMiddleware to Http.Abstractions. #312

Merged
merged 1 commit into from
May 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using System;
using System.Linq;
using System.Reflection;
using Microsoft.Framework.DependencyInjection;
using System.Threading.Tasks;
using Microsoft.AspNet.Http;
using Microsoft.Framework.Internal;

namespace Microsoft.AspNet.Builder
{
Expand All @@ -27,7 +27,7 @@ public static IApplicationBuilder UseMiddleware(this IApplicationBuilder builder
var parameters = methodinfo.GetParameters();
if (parameters[0].ParameterType != typeof(HttpContext))
{
throw new Exception("TODO: Middleware Invoke method must take first argument of HttpContext");
throw new Exception("Middleware Invoke method must take first argument of HttpContext");
}
if (parameters.Length == 1)
{
Expand All @@ -38,7 +38,7 @@ public static IApplicationBuilder UseMiddleware(this IApplicationBuilder builder
var serviceProvider = context.RequestServices ?? context.ApplicationServices ?? applicationServices;
if (serviceProvider == null)
{
throw new Exception("TODO: IServiceProvider is not available");
throw new Exception("IServiceProvider is not available");
}
var arguments = new object[parameters.Length];
arguments[0] = context;
Expand All @@ -48,7 +48,7 @@ public static IApplicationBuilder UseMiddleware(this IApplicationBuilder builder
arguments[index] = serviceProvider.GetService(serviceType);
if (arguments[index] == null)
{
throw new Exception(string.Format("TODO: No service for type '{0}' has been registered.", serviceType));
throw new Exception(string.Format("No service for type '{0}' has been registered.", serviceType));
}
}
return (Task)methodinfo.Invoke(instance, arguments);
Expand Down
2 changes: 2 additions & 0 deletions src/Microsoft.AspNet.Http.Abstractions/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"version": "1.0.0-*",
"description": "ASP.NET 5 HTTP object model. HttpContext and family.",
"dependencies": {
"Microsoft.Framework.ActivatorUtilities.Sources": { "type": "build", "version": "1.0.0-*" },
"Microsoft.Framework.NotNullAttribute.Sources": { "type": "build", "version": "1.0.0-*" },
"Microsoft.Framework.WebEncoders.Core": "1.0.0-*"
},
Expand All @@ -16,6 +17,7 @@
"System.Linq": "4.0.0-beta-*",
"System.Net.Primitives": "4.0.10-beta-*",
"System.Net.WebSockets" : "4.0.0-beta-*",
"System.Reflection.TypeExtensions": "4.0.0-beta-*",
"System.Runtime": "4.0.20-beta-*",
"System.Runtime.InteropServices": "4.0.20-beta-*",
"System.Security.Cryptography.X509Certificates": "4.0.0-beta-*",
Expand Down
2 changes: 0 additions & 2 deletions src/Microsoft.AspNet.Http.Extensions/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"dependencies": {
"Microsoft.AspNet.Http.Abstractions": "1.0.0-*",
"Microsoft.AspNet.Http.Features": "1.0.0-*",
"Microsoft.Framework.DependencyInjection.Abstractions": "1.0.0-*",
"Microsoft.Framework.NotNullAttribute.Sources": { "type": "build", "version": "1.0.0-*" },
"Microsoft.Framework.WebEncoders.Core": "1.0.0-*",
"Microsoft.Net.Http.Headers": "1.0.0-*"
Expand All @@ -15,7 +14,6 @@
"dnxcore50": {
"dependencies": {
"System.IO.FileSystem": "4.0.0-beta-*",
"System.Reflection.TypeExtensions": "4.0.0-beta-*",
"System.Runtime": "4.0.20-beta-*"
}
}
Expand Down