PredicateExpression.ToHumanReadableWhereFilterString()

Posts   
 
    
morten71
User
Posts: 80
Joined: 13-Jan-2009
# Posted on: 23-Mar-2023 09:20:34   

I'm dynamically building a PredicateExpression from passed parameters and would like to log what filter/where clause is passed to the database. Is there an easy method (like PredicateExpression.ToHumanReadableWhereFilterString()) to achieve this? Thanks. /Morten

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 23-Mar-2023 18:13:23   

"ToHumanReadable" what exaclty do you mean by that, could you give an example?

Would you consider the generated SQL as a human readable format?

If yes, then you can either use the ToQueryText() or use the built in Tracing system using a Trance Listener, to capture the [database]DQE trace.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 23-Mar-2023 19:25:37   

And to log something from code to an existing tracer, use something like

TraceHelper.WriteLineIf(TraceHelper.PersistenceExecutionSwitch.TraceInfo, "method name", "what you want to log");

where TraceHelper.PersistenceExecutionSwitch is the trace switch you want to log to and the TraceInfo the severity you want to limit the trace on.

Frans Bouma | Lead developer LLBLGen Pro