What exactly do you want? You can only capture an expression from Where- something like:
Expression<Func<SomeType, bool>> predicate = row => row.IsActive
&& row.Color == "red";
Since this happens with the expression tree, there is meaningful ToString().
If you want SQL (etc.) then this will be implementation specific. For example, with LINQ-to-SQL you can use .Log- for example,ctx.Log = Console.Out;
If you want the predicate to go out of the middle of the feed IQueryable<T>, itβs a lot more complicated ...
source
share