如何使用流畅的nhibernate设置generate_statistics = true

And*_*ock 24 fluent-nhibernate

根据我的理解,我需要最终得到这个

<property name="hibernate.generate_statistics">true</property>
Run Code Online (Sandbox Code Playgroud)

在会话工厂配置,但我不知道如何使用流畅的nhibernate.

And*_*ock 29

Configuration.ExposeConfiguration(c => c.SetProperty("generate_statistics", "true"));
Run Code Online (Sandbox Code Playgroud)


小智 10

在NHibernate 3中避免使用字符串:

Configuration.ExposeConfiguration(c => c.SetProperty(NHibernate.Cfg.Environment.GenerateStatistics, "true"));
Run Code Online (Sandbox Code Playgroud)


Jam*_*ory 8

根据您配置Fluent NHibernate的方式,数据库配置有一个Raw方法可用于指定我们尚未实现的设置.

SQLiteConfiguration.Standard
  .Raw("hibernate.generate_statistics", "true");
Run Code Online (Sandbox Code Playgroud)