I need a way to recreate dynamically generated reports at some point in the future. Long story short, I need to store a specific linq query (different for each report) into database and then execute the query with dynamic Linq later on.
This is all good, but I can't find a way to convert expression to string.
As in:
Expression<Func<Product, bool>> exp = (x) => (x.Id > 5 && x.Warranty != false);
should become:
"Product.Id > 5 && Product.Warranty != false"
Is there a way to do that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…