24

From what I understand I need to end up with this

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

on the session factory configuration, but I've no idea how to do that with fluent nhibernate.

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
Andrew Bullock
  • 36,616
  • 34
  • 155
  • 231

3 Answers3

29
Configuration.ExposeConfiguration(c => c.SetProperty("generate_statistics", "true"));
Andrew Bullock
  • 36,616
  • 34
  • 155
  • 231
10

In NHibernate 3 to avoid strings:

Configuration.ExposeConfiguration(c => c.SetProperty(NHibernate.Cfg.Environment.GenerateStatistics, "true"));
Micha
  • 5,117
  • 8
  • 34
  • 47
user1145840
  • 101
  • 1
  • 3
8

Depending on how you're configuring Fluent NHibernate, the Database Configuration has a Raw method that you can use to specify settings that we haven't implemented yet.

SQLiteConfiguration.Standard
  .Raw("hibernate.generate_statistics", "true");
James Gregory
  • 14,173
  • 2
  • 42
  • 60