Fix for #36 - IBuilder extension methods should take IRouter

This commit is contained in:
Ryan Nowak 2014-05-30 15:57:40 -07:00
parent 5dc8267920
commit 5616ce0bfa
1 changed files with 2 additions and 4 deletions

View File

@ -1,17 +1,15 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Routing;
namespace Microsoft.AspNet.Builder
{
public static class BuilderExtensions
{
public static IBuilder UseRouter(this IBuilder builder, IRouteCollection routes)
public static IBuilder UseRouter([NotNull] this IBuilder builder, [NotNull] IRouter router)
{
builder.Use((next) => new RouterMiddleware(next, routes).Invoke);
builder.Use((next) => new RouterMiddleware(next, router).Invoke);
return builder;
}
}