/// <summary> /// The job of this method is invoke an action and ultimately populate the /// </summary> /// <param name="application">The current application</param> /// <param name="context">A context which stores the request and response contexts.</param> public async Task Execute(MvcApplication application, NavigationContext context) { Initialize(application, context); var action = RouteData.Action; var actionResult = await ActionInvoker.InvokeAction(ControllerContext, action); var view = ((ViewResult)actionResult).View; view.Initialize(application.CreateViewContext(this)); context.Response.View = view; }
public MvcApplication() { instance = this; DependencyResolver = new ReflectionDependencyResolver(); }
protected virtual void Initialize(MvcApplication application, NavigationContext requestContext) { NavigationContext = requestContext; ActionInvoker = new ControllerActionInvoker(); ControllerContext = new ControllerContext { Application = application, NavigationContext = NavigationContext, Controller = this }; }