narsil/Tanshu.Accounts.Repository/Fluent/QueryStore.cs
2011-03-12 17:12:02 +05:30

39 lines
842 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Conventions;
using FluentNHibernate.Conventions.Instances;
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;
}
}
}