How to log SQL calls with NHibernate to the console of Visual Studio?

前端 未结 5 1139
小蘑菇
小蘑菇 2020-12-02 11:21

I have the following configuration file for NHibernate:




        
5条回答
  •  不思量自难忘°
    2020-12-02 11:47

    Since NHibernate 3.0 you can use loquacious configuration

    configuration.DataBaseIntegration(x =>
    {
      x.LogSqlInConsole = true;
      x.LogFormattedSql = true;
    });
    

    Others info available at http://fabiomaulo.blogspot.com.ar/2009/07/nhibernate-configuration-through.html

提交回复
热议问题