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

Not sure why but seems the parameter "defaultHandler" is useless here #294

Closed
4engkai opened this issue Mar 8, 2016 · 1 comment
Closed
Assignees
Milestone

Comments

@4engkai
Copy link

4engkai commented Mar 8, 2016

https://github.com/aspnet/Routing/blob/dev/src/Microsoft.AspNetCore.Routing/RouteBuilder.cs

public RouteBuilder(IApplicationBuilder applicationBuilder, IRouter defaultHandler)
{
    if (applicationBuilder == null)
    {
        throw new ArgumentNullException(nameof(applicationBuilder));
    }

    if (applicationBuilder.ApplicationServices.GetService(typeof(RoutingMarkerService)) == null)
    {
        throw new InvalidOperationException(Resources.FormatUnableToFindServices(
            nameof(IServiceCollection),
            nameof(RoutingServiceCollectionExtensions.AddRouting),
            "ConfigureServices(...)"));
    }

    ApplicationBuilder = applicationBuilder;
    ServiceProvider = applicationBuilder.ApplicationServices;

    Routes = new List<IRouter>();
}
@Eilon
Copy link
Member

Eilon commented Mar 9, 2016

Ah, that looks like a bug! I think it just needs to set the DefaultHandler property to that value.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants