2
Hello, I would like to know how to see the sql code that a String expression generates to be executed by ADO.Net.
I am using Nhibernate as a ORM framework.
2
Hello, I would like to know how to see the sql code that a String expression generates to be executed by ADO.Net.
I am using Nhibernate as a ORM framework.
1
Do a function like this
public string GetGeneratedSql(System.Linq.IQueryable queryable, ISession session)
{
var sessionImp = (ISessionImplementor) session;
var nhLinqExpression = new NhLinqExpression(queryable.Expression, sessionImp.Factory);
var translatorFactory = new ASTQueryTranslatorFactory();
var translators = translatorFactory.CreateQueryTranslators(nhLinqExpression, null, false, sessionImp.EnabledFilters, sessionImp.Factory);
return translators[0].SQLString;
}
Browser other questions tagged c# .net linq nhibernate
You are not signed in. Login or sign up in order to post.
Note as option too that answer!
– Fernando Leal