public void Initialized(Configuration cfg, ISessionFactory sessionFactory)
 {
     EntitiesToRepositories.Register(
         IoC.Container,
         sessionFactory,
         typeof(NHRepository <>),
         isCandidateForRepository);
 }
        private ISessionFactory CreateSessionFactory(NHibernateUnitOfWorkFacilityConfig config)
        {
            var cfg = new Configuration().Configure(config.NHibernateConfigurationFile);

            foreach (var mappedEntity in config.Entities)
            {
                cfg.AddClass(mappedEntity);
            }

            var sessionFactory = cfg.BuildSessionFactory();

            EntitiesToRepositories.Register(Kernel, sessionFactory, typeof(NHRepository <>), config.IsCandidateForRepository);
            return(sessionFactory);
        }