Friday, February 25, 2011

FubuMVC - IOC Container

Another niceties of FubuMVC is that it has its own IOC in its heart. Right now just StructureMap is supported but it's been said that other well-known IOC containers might be supported in future (Castle windsor, Autofac,.. even Unity!!)

Look how easy it is to bootstrap IOC in application's startup evet:
 
// ConfigureFubuMVC is explained in the last post



And NhibernateRegsitry class contains all information for our interfaces.
    public class NHibernateRegistry : Registry
    {
        public NHibernateRegistry()
        {
            ForSingletonOf().Use();
            For().HybridHttpOrThreadLocalScoped().Use();
            ....
            .......
        }
    }


No comments:

Post a Comment