public static void Main(string[] args) { NHibernateProfiler.Initialize(); IRootResolver rootResolver = IocBuilder.New .UseAutofacContainerBuilder() .UseStove <StoveDemoBootstrapper>() .UseStoveNullLogger() .UseStoveNHibernate(nhCfg => { nhCfg.FluentConfiguration .Database(MsSqlConfiguration.MsSql2012.ConnectionString(nhCfg.Configuration.DefaultNameOrConnectionString)) .Mappings(m => m.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly())); return(nhCfg); }) .UseStoveDefaultConnectionStringResolver() .UseStoveDapper() .UseStoveEventBus() .RegisterServices(r => r.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly())) .CreateResolver(); using (rootResolver) { rootResolver.Resolve <ProductDomainService>().DoSomeCoolStuff(); } NHibernateProfiler.Shutdown(); Console.ReadLine(); }
protected override void Dispose(bool disposing) { if (disposing) { NHibernateProfiler.Shutdown(); } base.Dispose(disposing); }
protected override void Dispose(bool disposing) { if (disposing) { #if DEBUG NHibernateProfiler.Shutdown(); #endif } base.Dispose(disposing); }
protected override void OnFixtureTeardown() { if (m_SessionFactory != null) { m_SessionFactory.Close(); m_SessionFactory = null; } if (UseProfiler) { NHibernateProfiler.Shutdown(); } base.OnFixtureTeardown(); }