Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 ASP.NET MVC 和 Nhibernate 项目的 DLL,它有一些模型和映射。在我的项目中,我参考了那个 DLL。现在我希望当我运行 Nhibernate 项目时,DLL 中存在的模型的 GenrateSchema 我该怎么做?
从您的 NHibernate 配置中,您可以创建一个新的 SchemaExport 对象并在其上调用 Create
例如:
var cfg = BuildNHibernateConfiguration(); new SchemaExport(cfg).Create(true,true);