示例#1
0
        protected override void Init()
        {
            var config = DatabaseConfigurator.SetEntities().BuildConfiguration();

            Kernel.Register(
                Component.For <ISessionFactory>().UsingFactoryMethod(config.BuildSessionFactory),
                Component.For <ISession>().UsingFactoryMethod(k => k.Resolve <ISessionFactory>().OpenSession()).LifeStyle.PerWebRequest
                );
        }
示例#2
0
        public ActionResult Tabelas()
        {
            new SchemaExport(DatabaseConfigurator.SetEntities().BuildConfiguration()).Execute(false, true, false);

            return(View());
        }