diff --git a/samples/MvcSample.Web/Startup.cs b/samples/MvcSample.Web/Startup.cs index fbf385796f..2a02529425 100644 --- a/samples/MvcSample.Web/Startup.cs +++ b/samples/MvcSample.Web/Startup.cs @@ -19,7 +19,7 @@ namespace MvcSample.Web var routes = new RouteCollection() { - DefaultHandler = new MvcApplication(serviceProvider), + DefaultHandler = new MvcRouteHandler(), }; // TODO: Add support for route constraints, so we can potentially constrain by existing routes diff --git a/src/Microsoft.AspNet.Mvc.Core/Microsoft.AspNet.Mvc.Core.kproj b/src/Microsoft.AspNet.Mvc.Core/Microsoft.AspNet.Mvc.Core.kproj index fa0472d5e8..097cfb1f33 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Microsoft.AspNet.Mvc.Core.kproj +++ b/src/Microsoft.AspNet.Mvc.Core/Microsoft.AspNet.Mvc.Core.kproj @@ -113,7 +113,7 @@ - + diff --git a/src/Microsoft.AspNet.Mvc.Core/MvcApplication.cs b/src/Microsoft.AspNet.Mvc.Core/MvcRouteHandler.cs similarity index 93% rename from src/Microsoft.AspNet.Mvc.Core/MvcApplication.cs rename to src/Microsoft.AspNet.Mvc.Core/MvcRouteHandler.cs index fdd78367ca..292faa9a9d 100644 --- a/src/Microsoft.AspNet.Mvc.Core/MvcApplication.cs +++ b/src/Microsoft.AspNet.Mvc.Core/MvcRouteHandler.cs @@ -11,15 +11,8 @@ using Microsoft.AspNet.Routing; namespace Microsoft.AspNet.Mvc { - public class MvcApplication : IRouter + public class MvcRouteHandler : IRouter { - private readonly IServiceProvider _serviceProvider; - - public MvcApplication([NotNull] IServiceProvider serviceProvider) - { - _serviceProvider = serviceProvider; - } - public string GetVirtualPath([NotNull] VirtualPathContext context) { // The contract of this method is to check that the values coming in from the route are valid; @@ -81,7 +74,7 @@ namespace Microsoft.AspNet.Mvc return null; } - var applicationServices = httpContext.ApplicationServices ?? _serviceProvider; + var applicationServices = httpContext.ApplicationServices; var scopeFactory = applicationServices.GetService(); var scope = scopeFactory.CreateScope();