internal ActionContext(ActionHandler handler, IHttpContext context) { Handler = handler; mFilters = handler.Filters; HttpContext = context; Parameters = handler.GetParameters(context); }
internal ActionContext(ActionHandler handler, IHttpContext context, ActionHandlerFactory actionHandlerFactory) { Handler = handler; mFilters = handler.Filters; HttpContext = context; ActionHandlerFactory = actionHandlerFactory; Parameters = handler.GetParameters(context); }
internal ActionContext(ActionHandler handler, IHttpContext context, ActionHandlerFactory actionHandlerFactory) { Handler = handler; mFilters = handler.Filters; HttpContext = context; ActionHandlerFactory = actionHandlerFactory; Parameters = handler.GetParameters(context); Controller = handler.Controller; if (!handler.SingleInstance) { Controller = actionHandlerFactory.GetController(handler.ControllerType); if (Controller == null) { Controller = this.Controller; } } }
internal ActionContext(ActionHandler handler, IHttpContext context, ActionHandlerFactory actionHandlerFactory) { Handler = handler; mFilters = handler.Filters; HttpContext = context; ActionHandlerFactory = actionHandlerFactory; Parameters = handler.GetParameters(context); Controller = handler.Controller; if (handler.InstanceType != InstanceType.Single) { if (handler.InstanceType == InstanceType.Session) { var factory = SessionControllerFactory.GetFactory(context.Session); Controller = factory[handler.ControllerUID]; if (Controller == null) { Controller = actionHandlerFactory.GetController(handler.ControllerType, context); if (Controller == null) { Controller = Activator.CreateInstance(handler.ControllerType); } factory[handler.ControllerUID] = Controller; } } else { Controller = actionHandlerFactory.GetController(handler.ControllerType, context); if (Controller == null) { Controller = Activator.CreateInstance(handler.ControllerType); } } } if (Controller == null) { Controller = handler.Controller; } }