How to know query generated by Fluent NHibernate

Rahul Somwanshi picture Rahul Somwanshi · May 4, 2009 · Viewed 24k times · Source

I am using linq to Nhibernate to fire some select query to data base.

My question is, how do I know, the query generated by Fluent NHibernate?

Answer

Kevin Berridge picture Kevin Berridge · May 22, 2009

With Fluent NHibernate, you can turn on show_sql like this:

Fluently.Configure()
    .Database( MsSqlConfiguration.MsSql2005.ShowSql().ConnectionString(...) )...

NHibernate will now print every sql statement to Console.Out.