sadomovalex/camlex

Discussion: Adding expressions to dynamically built multiple in clauses

sadomovalex opened this issue · 4 comments

rjn71[CodePlex]
Hi Sadomovalex

Thanks for your reply, unfortunately I didn't follow it properly. I couldn't find the method getWhereExpressionFromString anywhere. I couldn't find this method in Camlex.Query().

Btw, does the above method convert the where clause into an expression if it contains In clause?

Thanks

sadomovalex[CodePlex]
yes, as I wrote above In is not supported yet.

rjn71[CodePlex]
Hi Sadomovalex

I have replaced the In clause with multiple equal expressions combined with a WhereAny clause and it is working fine.

Regards

Rajesh

rjn71[CodePlex]
Hi Sadomovalex

I thought I would build my in query separately and add to other expressions using WhereAny expression as below

string searchQuery = Camlex.Query().WhereAny(inQuery, searchExpressions).ToString();

When I do this, I get the below exception.

WHERE tag contain element which can't be translated:
In
FieldRef Name=Location /
Values
Value Type=MultiChoiceUK/Value
Value Type=MultiChoiceUSA/Value
/Values
/In

at CamlexNET.Impl.ReverseEngeneering.Caml.Factories.ReAnalyzerFromCamlFactory.getAnalyzerForWhere(XElement el)

at CamlexNET.Impl.ReverseEngeneering.Caml.Factories.ReAnalyzerFromCamlFactory.Create(XElement el)

at CamlexNET.Impl.ReverseEngeneering.Caml.Factories.ReTranslatorFromCamlFactory.Create(String input)

at CamlexNET.Impl.Query.getWhereExpressionFromString(String existingWhere)
at CamlexNET.Impl.Query.WhereAny(String existingWhere, IEnumerable`1 expressions)

Looks like the WhereAny can't combine expressions with dynamically built In query. Am I doing anything wrong? Can't I build In query this way and combine with other expressions? If this doesn't work then I will have to go with Contains clause which
is supported by Camlex. Please confirm.

Regards

Rajesh

sadomovalex[CodePlex]
rjn71[CodePlex]
sadomovalex[CodePlex]
hi,
I meant that you can downloaded sources from
source code and add this method by yourself. The example which I showed above is from source code.
Currently In operation is not supported.