Fluent nhibernate 如何使用fluent nhibernate设置generate_statistics=true

Fluent nhibernate 如何使用fluent nhibernate设置generate_statistics=true,fluent-nhibernate,Fluent Nhibernate,据我所知,我需要以这个结束 <property name="hibernate.generate_statistics">true</property> true 在会话工厂配置上,但我不知道如何使用fluent nhibernate实现这一点。根据您配置fluent nhibernate的方式,有一个Raw方法,您可以使用该方法指定我们尚未实现的设置 Configuration.ExposeConfiguration(c => c.SetProperty("g

据我所知,我需要以这个结束

<property name="hibernate.generate_statistics">true</property>
true

在会话工厂配置上,但我不知道如何使用fluent nhibernate实现这一点。

根据您配置fluent nhibernate的方式,有一个
Raw
方法,您可以使用该方法指定我们尚未实现的设置

Configuration.ExposeConfiguration(c => c.SetProperty("generate_statistics", "true"));
SQLiteConfiguration.Standard
  .Raw("hibernate.generate_statistics", "true");

在NHibernate 3中,为了避免字符串:

Configuration.ExposeConfiguration(c => c.SetProperty(NHibernate.Cfg.Environment.GenerateStatistics, "true"));

谢谢省略hibernate部分对我来说很有用:xxxx.Raw(“生成统计数据”,“true”);但这似乎是使用Fluent更自然的方式。