示例#1
0
        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();
        }
示例#2
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         NHibernateProfiler.Shutdown();
     }
     base.Dispose(disposing);
 }
示例#3
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
#if DEBUG
                NHibernateProfiler.Shutdown();
#endif
            }
            base.Dispose(disposing);
        }
示例#4
0
        protected override void OnFixtureTeardown()
        {
            if (m_SessionFactory != null)
            {
                m_SessionFactory.Close();
                m_SessionFactory = null;
            }

            if (UseProfiler)
            {
                NHibernateProfiler.Shutdown();
            }

            base.OnFixtureTeardown();
        }