Get executed SQL from nHibernate

前端 未结 3 1674
青春惊慌失措
青春惊慌失措 2021-01-02 14:15

I am using nHibernate ICriteria to execute a query, and I would like to be able to get the SQL that was executed after the statement runs. So for example I have something li

3条回答
  •  情书的邮戳
    2021-01-02 14:40

    You can attach an IInterceptor to your NH ISession, then use the OnPrepareStatement() method to trap (even modify) the SQL.

提交回复
热议问题