implementing windsor controller registration

Continuing the custom Windsor registration series of posts this second post illustrates implementing the Windsor controller registration that was created in the previous post.
I do this with a simple implementation entry in the global.asax for the time being:

protected void Application_Start() 
{ 
    CreateWindsorContainer(); 
    WindsorControllerRegistration.RegisterControllersFrom(Assembly.GetExecutingAssembly(),
                                                           container); 
    RegisterRoutes(RouteTable.Routes); 
} 

private static void CreateWindsorContainer() 
{ 
    container = new WindsorContainer(); 
}

private IWindsorContainer container; 

The above code uses the static class illustrated in the previous post to register the controllers from the executing assembly but I will look to be improving the readability of this once the framework is in place through future posts.

The next step is to code a new Windsor component - the Windsor MVC Controller Factory and I'll cover this in my next post.



0 comments: