Generate Database from NHibernate config files

后端 未结 3 1519
轻奢々
轻奢々 2020-12-29 14:13

Is it possible to generate the database tables and c# classes from NHibernate config files? Afterwards, is it possible to change the config files and update the tables and

3条回答
  •  离开以前
    2020-12-29 14:57

    As mentioned by Joachim, it's the "hbm2ddl.auto" setting that you're looking for.

    You can set it by code like this:

    var cfg = new NHibernate.Cfg.Configuration();
    cfg.SetProperty("hbm2ddl.auto", "create");
    cfg.Configure();
    

    And you can also set it in your App.config file:

        
        
            create
    

提交回复
热议问题