Exemplo n.º 1
0
        protected ISessionFactory BuildSessionFactory(global::NHibernate.Cfg.Configuration configuration)
        {
            FluentConfiguration fluentConfiguration = Fluently.Configure(configuration);

            fluentConfiguration.Mappings(m =>
                                         {
                                             FluentConfigurationWrapper wrapper = new FluentConfigurationWrapper(configuration, m);

                                             ShowConfigurationToListeners(wrapper);

                                             if (wrapper.Database != null)
                                             {
                                                 fluentConfiguration.Database(wrapper.Database);
                                             }
                                         });

            return fluentConfiguration.BuildSessionFactory();
        }
Exemplo n.º 2
0
 private void ShowConfigurationToListeners(FluentConfigurationWrapper wrapper)
 {
     BuildListeners.ForEach(bl => bl.NotifyConfiguration(wrapper));
 }