Moved the routing up a level.
This commit is contained in:
parent
81a4cfbfbf
commit
e7ade37b3f
|
|
@ -20,12 +20,13 @@ namespace Microsoft.AspNet.Mvc
|
||||||
_serviceProvider = serviceProvider ?? MvcServices.Create();
|
_serviceProvider = serviceProvider ?? MvcServices.Create();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task ExecuteAsync(IOwinContext context)
|
public Task ExecuteAsync(IOwinContext context, IRouteData routeData)
|
||||||
{
|
{
|
||||||
var routeData = new FakeRouteData(context);
|
var requestContext = new RequestContext(context, routeData);
|
||||||
|
|
||||||
IActionInvokerFactory invokerFactory = _serviceProvider.GetService<IActionInvokerFactory>();
|
IActionInvokerFactory invokerFactory = _serviceProvider.GetService<IActionInvokerFactory>();
|
||||||
var invoker = invokerFactory.CreateInvoker(new RequestContext(context, routeData));
|
|
||||||
|
var invoker = invokerFactory.CreateInvoker(requestContext);
|
||||||
|
|
||||||
return invoker.InvokeActionAsync();
|
return invoker.InvokeActionAsync();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Mvc;
|
using Microsoft.AspNet.Mvc;
|
||||||
|
using Microsoft.AspNet.Mvc.Routing;
|
||||||
using Microsoft.Owin;
|
using Microsoft.Owin;
|
||||||
using Owin;
|
using Owin;
|
||||||
|
|
||||||
|
|
@ -16,10 +17,12 @@ namespace MvcSample
|
||||||
|
|
||||||
var handler = new MvcHandler();
|
var handler = new MvcHandler();
|
||||||
|
|
||||||
// Pretending to be routing
|
|
||||||
app.Run(async context =>
|
app.Run(async context =>
|
||||||
{
|
{
|
||||||
await handler.ExecuteAsync(context);
|
// Pretending to be routing
|
||||||
|
var routeData = new FakeRouteData(context);
|
||||||
|
|
||||||
|
await handler.ExecuteAsync(context, routeData);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue