This project has moved and is read-only. For the latest updates, please go here.

How to parse existing string query to Query object?

Mar 20, 2016 at 10:42 PM
I want to modify existing string CAML query and add additional where expression.

I have found a method Camlex.QueryFromString(camlQuery), but cannot understand how to use it.
Mar 20, 2016 at 10:52 PM
I think I found the answer

Thank you for the excellent product. I'm happy to use it.
Jun 15 at 3:29 PM
Edited Jun 15 at 3:30 PM
You can use reflection:
var query  = Camlex.Query();
MethodInfo getWhereExpressionFromStringMethod = query.GetType().GetMethod("getWhereExpressionFromString", BindingFlags.Instance | BindingFlags.NonPublic);
object[] getWhereExpressionFromStringParams = { you_CAML_string};

var expression  = getWhereExpressionFromStringMethod.Invoke(query, getWhereExpressionFromStringParams) as Expression<Func<SPListItem, bool>>;