/ Published in: C#
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public class WindsorControllerFactory : DefaultControllerFactory { private readonly IWindsorContainer container; public WindsorControllerFactory(IWindsorContainer container) { this.container = container; } public override void ReleaseController(IController controller) { container.Kernel.ReleaseComponent(controller); } protected override IController GetControllerInstance(RequestContext context, Type controllerType) { if (controllerType == null) base.GetControllerInstance(context, controllerType); return (IController)container.Kernel.Resolve(controllerType); } }