Also removing the overload that doesn't take a route collection
This commit is contained in:
parent
1a9c0ad548
commit
06c63c38a1
|
|
@ -8,7 +8,8 @@ namespace RoutingSample.Web
|
||||||
{
|
{
|
||||||
public void Configuration(IBuilder builder)
|
public void Configuration(IBuilder builder)
|
||||||
{
|
{
|
||||||
var routes = builder.UseRouter();
|
var routes = new RouteCollection();
|
||||||
|
builder.UseRouter(routes);
|
||||||
|
|
||||||
var endpoint1 = new DelegateRouteEndpoint(async (context) =>
|
var endpoint1 = new DelegateRouteEndpoint(async (context) =>
|
||||||
await context.HttpContext.Response.WriteAsync(
|
await context.HttpContext.Response.WriteAsync(
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,10 @@ namespace Microsoft.AspNet.Abstractions
|
||||||
{
|
{
|
||||||
public static class BuilderExtensions
|
public static class BuilderExtensions
|
||||||
{
|
{
|
||||||
public static IRouteCollection UseRouter(this IBuilder builder)
|
public static IBuilder UseRouter(this IBuilder builder, IRouteCollection routes)
|
||||||
{
|
|
||||||
return UseRouter(builder, new RouteCollection());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IRouteCollection UseRouter(this IBuilder builder, IRouteCollection routes)
|
|
||||||
{
|
{
|
||||||
builder.Use((next) => new RouterMiddleware(next, routes).Invoke);
|
builder.Use((next) => new RouterMiddleware(next, routes).Invoke);
|
||||||
return routes;
|
return builder;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue