narsil/Tanshu.Accounts.Repository/Fluent/QueryStore.cs

33 lines
674 B
C#
Raw Normal View History

using NHibernate;
using NHibernate.SqlCommand;
using System.Diagnostics;
namespace Tanshu.Accounts.SqlDAO
{
public static class QueryStore
{
private static string query;
public static string Query
{
get
{
return query;
}
set
{
query = value;
Debug.Write(query);
}
}
}
public class NHSQLInterceptor : EmptyInterceptor, IInterceptor
{
SqlString IInterceptor.OnPrepareStatement(SqlString sql)
{
QueryStore.Query = sql.ToString();
return sql;
}
}
}