Hi all,
I have a proble, where I'm really lost. Probably there is an easy solutuion, but I can't see it so far.
We have our own - very old - expressions and want to convert those into such construct, that we can use it in a Linq Where clause like this
var exp = OurExpression
"from a in m_LinqMetaData.Table Where(exp) select a"
So far I have converted all our expressions into PredicateExpressions:
var fieldName = "AnyFieldName";
var field = new EntityField(fieldName, (IExpression) null);
var pexp = new PredicateExpression(new FieldCompareValuePredicate(field, ComparisonOperator.Equal, any_value));
The final piece is the mystery part for me - how can I convert the Predicateexpression into such an statement, that I can use it in the Wher clause. I also have implemented my own Where which is based on Expression, but both classes - also when they are named similiar - are not derived from each other.
For several reason I'm focusing on a Linq based solution.
There is no knowledge about the fieldName during compile time. The DynamicLinq approach works fine, but there is no support for several functions I need. The PredicateBuilder is here not helpful.
Thanks for any help,
Matthias