Is there a way to access the full SQL query, including the values, inside my code?
I am able to log SQL queries using log4net:
You can override driver:
public class LoggerSqlClientDriver:SqlClientDriver, IEmbeddedBatcherFactoryProvider
{
public override void AdjustCommand(IDbCommand command)
{
//log here
base.AdjustCommand(command);
}
//protected override void OnBeforePrepare(IDbCommand command)
//{
// //log here
// base.OnBeforePrepare(command);
//}
}
And then use it in configuration:
var config = Fluently.Configure().
Database(MsSqlConfiguration.MsSql2005.Driver();