<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>camlex Discussions Rss Feed</title><link>http://camlex.codeplex.com/Thread/List.aspx</link><description>camlex Discussions Rss Description</description><item><title>New Post: Project SPListItem to a strongly typed class</title><link>http://camlex.codeplex.com/discussions/438324</link><description>&lt;div style="line-height: normal;"&gt;hi cadrell0,&lt;br /&gt;
this is interesting idea. But use case is not very clear at the moment. If we are talking about SPMetal strongly-generated class, then most probably developers will use Linq 2 Sharepoint. So probably this feature will help in situations when we create POC class and map SPListItem to it by ourselves (I don't think people will create strongly-typed classes which will be only used for writing strongly-typed queries with Camlex). Do you have other scenarios, where this feature will help?&lt;br /&gt;
&lt;br /&gt;
In general it should be possible to implement it, although I can't say at the moment how easy it will be. For SPListItem we currently use indexer operations, so we will need to add support for retrieving property names. Will add this feature to the [Future improvements](camlex.codeplex.com/wikipage?title=Future improvements), but there are other features in the queue now. You may send pull requests and I will review it.&lt;br /&gt;
&lt;br /&gt;
I've just tried to download the source code (from &lt;a href="http://camlex.codeplex.com/SourceControl/list/changesets" rel="nofollow"&gt;Source code&lt;/a&gt;) - it works. So may be it was temporary problem on Codeplex.&lt;br /&gt;
&lt;/div&gt;</description><author>sadomovalex</author><pubDate>Sat, 30 Mar 2013 06:27:29 GMT</pubDate><guid isPermaLink="false">New Post: Project SPListItem to a strongly typed class 20130330062729A</guid></item><item><title>New Post: Project SPListItem to a strongly typed class</title><link>http://camlex.codeplex.com/discussions/438324</link><description>&lt;div style="line-height: normal;"&gt;I'm completely new to SharePoint, so you'll have to forgive me if this is a completely ridiculous idea, however, I'm going to ask anyway.&lt;br /&gt;
&lt;br /&gt;
How hard would it be to use strongly typed classes to generate the query rather than basing everything off of SPListItem?&lt;br /&gt;
&lt;br /&gt;
Instead of &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;var caml =
    Camlex.Query()
        .Where(x =&amp;gt; (string)x[&amp;quot;Status&amp;quot;] == &amp;quot;New&amp;quot;)
        .ToString();&lt;/code&gt;&lt;/pre&gt;

I'm thinking something like &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;    Camlex.Query&amp;lt;MyClass&amp;gt;()
        .Where(x =&amp;gt; x.Status == &amp;quot;New&amp;quot;)
        .ToString();&lt;/code&gt;&lt;/pre&gt;

MyClass would look something like&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;    public class MyClass
    {
        public string Status { get; set; }
    }&lt;/code&gt;&lt;/pre&gt;

Because Where takes an Expression, it shouldn't be hard to extract the property Name or Type.&lt;br /&gt;
&lt;br /&gt;
I was going to look how you are building the CAML to see how feasible this is, but I get an error on the Source Code page.  Not sure if that is a CodePlex issue or something on your end.&lt;br /&gt;
&lt;/div&gt;</description><author>cadrell0</author><pubDate>Thu, 28 Mar 2013 13:48:32 GMT</pubDate><guid isPermaLink="false">New Post: Project SPListItem to a strongly typed class 20130328014832P</guid></item><item><title>New Post: Camlex and Joins</title><link>http://camlex.codeplex.com/discussions/310033</link><description>&lt;div style="line-height: normal;"&gt;hi ibragimdeltorro,&lt;br /&gt;
no news yet unfortunately about this functionality. In nearest releases I'm planning to add other features for SP2010 (e.g. In clause), joins will go after it. But can't provide exact date due to the extremely high workload. Also I reconsidered the plans about separate branches for different Sharepoint version - most probably it will be still separate branches for different APIs only (basic OM and client OM) as it is now.&lt;br /&gt;
Also remember that you always may send pull request by yourself.&lt;br /&gt;
&lt;/div&gt;</description><author>sadomovalex</author><pubDate>Thu, 14 Mar 2013 21:40:07 GMT</pubDate><guid isPermaLink="false">New Post: Camlex and Joins 20130314094007P</guid></item><item><title>New Post: Camlex and Joins</title><link>http://camlex.codeplex.com/discussions/310033</link><description>&lt;div style="line-height: normal;"&gt;whats news?&lt;br /&gt;
&lt;/div&gt;</description><author>ibragimdeltorro</author><pubDate>Thu, 14 Mar 2013 10:19:48 GMT</pubDate><guid isPermaLink="false">New Post: Camlex and Joins 20130314101948A</guid></item><item><title>New Post: download camlex reverse engineering offline</title><link>http://camlex.codeplex.com/discussions/433232</link><description>&lt;div style="line-height: normal;"&gt;hi kavalirakesh,&lt;br /&gt;
Camlex.NET.dll contains base for reverse engineering: transformation from CAML to expression tree. After that it is up to you how you will use this expression tree. One of the application - is to generate C# code as we did on the &lt;a href="http://camlex-online.org." rel="nofollow"&gt;http://camlex-online.org.&lt;/a&gt; C# generation from expression tree is not part of Camlex and we won't include it here. We used another open source project expression2code for it (with several changes). Another application of reverse engineering - add conditions into existing string queries using lambda expressions. And there will be more in future.&lt;br /&gt;
&lt;/div&gt;</description><author>sadomovalex</author><pubDate>Fri, 15 Feb 2013 08:20:36 GMT</pubDate><guid isPermaLink="false">New Post: download camlex reverse engineering offline 20130215082036A</guid></item><item><title>New Post: download camlex reverse engineering offline</title><link>http://camlex.codeplex.com/discussions/433232</link><description>&lt;div style="line-height: normal;"&gt;HI&lt;br /&gt;
&lt;br /&gt;
camlex is excelent product saved my time to create dynamic CAML.&lt;br /&gt;
i saw the camlex reverse engineering online its more excellent.&lt;br /&gt;
can i use the camlex reverse engineering as offline use.&lt;br /&gt;
means like camlex .dll can i download the camlex reverse engineering.&lt;br /&gt;
so i can implement in my projects to create bidirectional caml queries.&lt;br /&gt;
thanks&lt;br /&gt;
rakesh&lt;br /&gt;
&lt;/div&gt;</description><author>kavalirakesh</author><pubDate>Fri, 15 Feb 2013 07:25:13 GMT</pubDate><guid isPermaLink="false">New Post: download camlex reverse engineering offline 20130215072513A</guid></item><item><title>New Post: Adding expressions to dynamically built multiple in clauses</title><link>http://camlex.codeplex.com/discussions/431325</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;yes, as I wrote above In is not supported yet.&lt;/p&gt;
&lt;/div&gt;</description><author>sadomovalex</author><pubDate>Sun, 03 Feb 2013 18:17:44 GMT</pubDate><guid isPermaLink="false">New Post: Adding expressions to dynamically built multiple in clauses 20130203061744P</guid></item><item><title>New Post: Adding expressions to dynamically built multiple in clauses</title><link>http://camlex.codeplex.com/discussions/431325</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi Sadomovalex&lt;/p&gt;
&lt;p&gt;I have replaced the In clause with multiple equal expressions combined with a WhereAny clause and it is working fine.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Rajesh&lt;/p&gt;
&lt;/div&gt;</description><author>rjn71</author><pubDate>Fri, 01 Feb 2013 21:55:47 GMT</pubDate><guid isPermaLink="false">New Post: Adding expressions to dynamically built multiple in clauses 20130201095547P</guid></item><item><title>New Post: Adding expressions to dynamically built multiple in clauses</title><link>http://camlex.codeplex.com/discussions/431325</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi Sadomovalex&lt;/p&gt;
&lt;p&gt;I thought I would build my in query separately and add to other expressions using WhereAny expression as below&lt;/p&gt;
&lt;p&gt;string searchQuery = Camlex.Query().WhereAny(inQuery, searchExpressions).ToString();&lt;/p&gt;
&lt;p&gt;When I do this, I get the below exception.&lt;/p&gt;
&lt;p&gt;WHERE tag contain element which can't be translated: &lt;br /&gt;
&amp;lt;In&amp;gt;&lt;br /&gt;
  &amp;lt;FieldRef Name=&amp;quot;Location&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Values&amp;gt;&lt;br /&gt;
    &amp;lt;Value Type=&amp;quot;MultiChoice&amp;quot;&amp;gt;UK&amp;lt;/Value&amp;gt;&lt;br /&gt;
    &amp;lt;Value Type=&amp;quot;MultiChoice&amp;quot;&amp;gt;USA&amp;lt;/Value&amp;gt;&lt;br /&gt;
  &amp;lt;/Values&amp;gt;&lt;br /&gt;
&amp;lt;/In&amp;gt;&lt;/p&gt;
&lt;p&gt;at CamlexNET.Impl.ReverseEngeneering.Caml.Factories.ReAnalyzerFromCamlFactory.getAnalyzerForWhere(XElement el)&lt;br /&gt;
   at CamlexNET.Impl.ReverseEngeneering.Caml.Factories.ReAnalyzerFromCamlFactory.Create(XElement el)&lt;br /&gt;
   at CamlexNET.Impl.ReverseEngeneering.Caml.Factories.ReTranslatorFromCamlFactory.Create(String input)&lt;br /&gt;
   at CamlexNET.Impl.Query.getWhereExpressionFromString(String existingWhere)&lt;br /&gt;
   at CamlexNET.Impl.Query.WhereAny(String existingWhere, IEnumerable`1 expressions)&lt;/p&gt;
&lt;p&gt;Looks like the WhereAny can't combine expressions with dynamically built In query. Am I doing anything wrong? Can't I build &amp;quot;In&amp;quot; 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.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Rajesh&lt;/p&gt;
&lt;/div&gt;</description><author>rjn71</author><pubDate>Thu, 31 Jan 2013 23:39:52 GMT</pubDate><guid isPermaLink="false">New Post: Adding expressions to dynamically built multiple in clauses 20130131113952P</guid></item><item><title>New Post: Adding expressions to dynamically built multiple in clauses</title><link>http://camlex.codeplex.com/discussions/431325</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;hi,&lt;br /&gt;
I meant that you can downloaded sources from &lt;a href="http://camlex.codeplex.com/SourceControl/changeset/view/751e0b0cd242" rel="nofollow"&gt;source code&lt;/a&gt; and add this method by yourself. The example which I showed above is from source code.&lt;br /&gt;
Currently In operation is not supported.&lt;/p&gt;
&lt;/div&gt;</description><author>sadomovalex</author><pubDate>Thu, 31 Jan 2013 08:19:09 GMT</pubDate><guid isPermaLink="false">New Post: Adding expressions to dynamically built multiple in clauses 20130131081909A</guid></item><item><title>New Post: Adding expressions to dynamically built multiple in clauses</title><link>http://camlex.codeplex.com/discussions/431325</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi Sadomovalex&lt;/p&gt;
&lt;p&gt;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(). &lt;/p&gt;
&lt;p&gt;Btw, does the above method convert the where clause into an expression if it contains &amp;quot;In&amp;quot; clause?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;/div&gt;</description><author>rjn71</author><pubDate>Thu, 31 Jan 2013 00:08:14 GMT</pubDate><guid isPermaLink="false">New Post: Adding expressions to dynamically built multiple in clauses 20130131120814A</guid></item><item><title>New Post: Adding expressions to dynamically built multiple in clauses</title><link>http://camlex.codeplex.com/discussions/431325</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Rajesh hi,&lt;/p&gt;
&lt;p&gt;currently no, it is not supported. But it is definitely interesting feature and I think it will be useful to add it to one of the next releases. It should not be complicated, so you can do it by yourself if will check implementation of WhereAny method:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;public&lt;/span&gt; IQuery WhereAny(&lt;span style="color:blue"&gt;string&lt;/span&gt; existingWhere, IEnumerable&amp;lt;Expression&amp;lt;Func&amp;lt;SPListItem, &lt;span style="color:blue"&gt;bool&lt;/span&gt;&amp;gt;&amp;gt;&amp;gt; expressions)
{
    &lt;span style="color:blue"&gt;var&lt;/span&gt; whereExpr = &lt;span style="color:blue"&gt;this&lt;/span&gt;.getWhereExpressionFromString(existingWhere);
    &lt;span style="color:blue"&gt;var&lt;/span&gt; exprs = &lt;span style="color:blue"&gt;new&lt;/span&gt; List&amp;lt;Expression&amp;lt;Func&amp;lt;SPListItem, &lt;span style="color:blue"&gt;bool&lt;/span&gt;&amp;gt;&amp;gt;&amp;gt;(expressions);
    exprs.Add(whereExpr);
    &lt;span style="color:blue"&gt;return&lt;/span&gt; &lt;span style="color:blue"&gt;this&lt;/span&gt;.WhereAny(exprs);
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;I.e. if you will have several string queries, you can call getWhereExpressionFromString() method for each, insert them to list and then call original WhereAny() method as in the example above.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description><author>sadomovalex</author><pubDate>Wed, 30 Jan 2013 20:50:24 GMT</pubDate><guid isPermaLink="false">New Post: Adding expressions to dynamically built multiple in clauses 20130130085024P</guid></item><item><title>New Post: Adding expressions to dynamically built multiple in clauses</title><link>http://camlex.codeplex.com/discussions/431325</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I'm building a query dynamically and there are a few fields which need &amp;quot;In&amp;quot; clause query. Since the Camlex expressions do not support In clause yet, I'm building the in claues separately as a where query. I have a couple of fields on which I'm
 creating this. I see that WhereAny takes an existing query, but only one query can be passed. Is there a way to pass multiple where caluses to existing expressions?&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Rajesh&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description><author>rjn71</author><pubDate>Tue, 29 Jan 2013 21:50:36 GMT</pubDate><guid isPermaLink="false">New Post: Adding expressions to dynamically built multiple in clauses 20130129095036P</guid></item><item><title>New Post: this support Author Lookup Field Query?</title><link>http://camlex.codeplex.com/discussions/430369</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;&amp;nbsp; I find this&amp;nbsp;http://camlex.codeplex.com/discussions/264821 ,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;string&lt;/span&gt; caml = Camlex.Query().Where(x =&amp;gt; x[&lt;span&gt;&amp;quot;Author&amp;quot;&lt;/span&gt;] == (DataTypes.UserId)&lt;span&gt;&amp;quot;123&amp;quot;&lt;/span&gt;).ToString();&lt;/pre&gt;
&lt;pre&gt;and&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;string caml = Camlex.Query().Where(x =&amp;gt; x[&amp;quot;Author&amp;quot;] == (DataTypes.Integer)Camlex.UserID).ToString();&lt;/pre&gt;
&lt;pre&gt;&lt;br&gt;&lt;/pre&gt;
&lt;pre&gt;cool, thanks;&lt;/pre&gt;
&lt;pre&gt;&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description><author>jinho</author><pubDate>Tue, 22 Jan 2013 04:37:53 GMT</pubDate><guid isPermaLink="false">New Post: this support Author Lookup Field Query? 20130122043753A</guid></item><item><title>New Post: this support Author Lookup Field Query?</title><link>http://camlex.codeplex.com/discussions/430369</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;
Camlex.net how do like this CAML Query：&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;int&lt;/span&gt; _id=web.EnsureUser(&lt;span style="color:#a31515"&gt;&amp;quot;loginName&amp;quot;&lt;/span&gt;).ID;
SPQuery query = &lt;span style="color:blue"&gt;new&lt;/span&gt; SPQuery();
query.Query = &lt;span style="color:#a31515"&gt;@&amp;quot;&amp;lt;Where&amp;gt;&amp;lt;Eq&amp;gt;&amp;lt;FieldRef Name='Author' LookupId='TRUE' /&amp;gt;&amp;lt;Value Type='Integer'&amp;gt;&amp;quot;&lt;/span&gt; &amp;#43; _id &amp;#43; &lt;span style="color:#a31515"&gt;@&amp;quot;&amp;lt;/Value&amp;gt;&amp;lt;/Eq&amp;gt;&amp;lt;/Where&amp;gt;&amp;lt;OrderBy&amp;gt;&amp;lt;FieldRef Name='Created' Ascending='False' /&amp;gt;&amp;lt;/OrderBy&amp;gt;&amp;quot;&lt;/span&gt;;

&lt;/pre&gt;
&lt;/div&gt;
thanks.
&lt;p&gt;&lt;/p&gt;
&lt;/div&gt;</description><author>Jinho</author><pubDate>Tue, 22 Jan 2013 04:33:23 GMT</pubDate><guid isPermaLink="false">New Post: this support Author Lookup Field Query? 20130122043323A</guid></item><item><title>New Post: Dynamic Caml expression - Contains clause</title><link>http://camlex.codeplex.com/discussions/429673</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi Sadomovalex&lt;/p&gt;
&lt;p&gt;Thanks for the reply and your approach. I guess I'll go with the one supported by Camlex. I don't think there's any downside to using all types as string(first one in the example) as opposed to SharePoint types(second one in the example).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Rajesh&lt;/p&gt;
&lt;/div&gt;</description><author>rjn71</author><pubDate>Wed, 16 Jan 2013 22:08:21 GMT</pubDate><guid isPermaLink="false">New Post: Dynamic Caml expression - Contains clause 20130116100821P</guid></item><item><title>New Post: Dynamic Caml expression - Contains clause</title><link>http://camlex.codeplex.com/discussions/429673</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;hi Rajesh,&lt;/p&gt;
&lt;p&gt;example with Contains can't be done exactly like you want. There are several reasons. First reason comes from C#: you can't cast object to type like this:&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;Type t = &lt;span style="color:blue"&gt;typeof&lt;/span&gt;(Foo);
&lt;span style="color:blue"&gt;object&lt;/span&gt; o = ...;
((t)o).MethodFromFooClass();
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;But this problem can be avoided: you need to separate list of expressions for each type like this:&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;struct&lt;/span&gt; SearchField&amp;lt;T&amp;gt; &lt;span style="color:blue"&gt;where&lt;/span&gt; T : StringBasedFieldType
{
    &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;string&lt;/span&gt; FieldName { &lt;span style="color:blue"&gt;get&lt;/span&gt;; &lt;span style="color:blue"&gt;set&lt;/span&gt;; }
}

...

&lt;span style="color:blue"&gt;string&lt;/span&gt; searchText = &lt;span style="color:#a31515"&gt;&amp;quot;test&amp;quot;&lt;/span&gt;;
&lt;span style="color:blue"&gt;var&lt;/span&gt; searchFields1 = &lt;span style="color:blue"&gt;new&lt;/span&gt; List&amp;lt;SearchField&amp;lt;DataTypes.Text&amp;gt;&amp;gt;
    {
        &lt;span style="color:blue"&gt;new&lt;/span&gt; SearchField&amp;lt;DataTypes.Text&amp;gt;{FieldName = &lt;span style="color:#a31515"&gt;&amp;quot;Title1&amp;quot;&lt;/span&gt;},
        &lt;span style="color:blue"&gt;new&lt;/span&gt; SearchField&amp;lt;DataTypes.Text&amp;gt;{FieldName = &lt;span style="color:#a31515"&gt;&amp;quot;Title2&amp;quot;&lt;/span&gt;},
    };
&lt;span style="color:blue"&gt;var&lt;/span&gt; searchFields2 = &lt;span style="color:blue"&gt;new&lt;/span&gt; List&amp;lt;SearchField&amp;lt;DataTypes.Note&amp;gt;&amp;gt;
    {
        &lt;span style="color:blue"&gt;new&lt;/span&gt; SearchField&amp;lt;DataTypes.Note&amp;gt;{FieldName = &lt;span style="color:#a31515"&gt;&amp;quot;Note1&amp;quot;&lt;/span&gt;},
        &lt;span style="color:blue"&gt;new&lt;/span&gt; SearchField&amp;lt;DataTypes.Note&amp;gt;{FieldName = &lt;span style="color:#a31515"&gt;&amp;quot;Note2&amp;quot;&lt;/span&gt;},
    };
&lt;span style="color:blue"&gt;var&lt;/span&gt; searchConditions = getExpressions(searchFields1, searchText);
searchConditions.AddRange(getExpressions(searchFields2, searchText));
Console.WriteLine(Camlex.Query().WhereAny(searchConditions).ToString());

...

&lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; List&amp;lt;Expression&amp;lt;Func&amp;lt;SPListItem, &lt;span style="color:blue"&gt;bool&lt;/span&gt;&amp;gt;&amp;gt;&amp;gt; getExpressions&amp;lt;T&amp;gt;(List&amp;lt;SearchField&amp;lt;T&amp;gt;&amp;gt; searchFields, &lt;span style="color:blue"&gt;string&lt;/span&gt; searchText)
    &lt;span style="color:blue"&gt;where&lt;/span&gt; T : StringBasedFieldType
{
    &lt;span style="color:blue"&gt;var&lt;/span&gt; result = &lt;span style="color:blue"&gt;new&lt;/span&gt; List&amp;lt;Expression&amp;lt;Func&amp;lt;SPListItem, &lt;span style="color:blue"&gt;bool&lt;/span&gt;&amp;gt;&amp;gt;&amp;gt;();
    &lt;span style="color:blue"&gt;foreach&lt;/span&gt; (&lt;span style="color:blue"&gt;var&lt;/span&gt; searchField &lt;span style="color:blue"&gt;in&lt;/span&gt; searchFields)
    {
        &lt;span style="color:blue"&gt;string&lt;/span&gt; fieldName = searchField.FieldName;
        result.Add(x =&amp;gt; ((T)x[fieldName]).Contains(searchText));
    }
    &lt;span style="color:blue"&gt;return&lt;/span&gt; result;
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;As you can see in this example we have 2 lists with search fields: one for DataTypes.Text and another for DataTypes.Note. Then we create search conditions from each list and merge results. It produces the following Caml:&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Where&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
  &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Or&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Or&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Or&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;FieldRef&lt;/span&gt; &lt;span style="color:red"&gt;Name&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;Title1&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt; &lt;span style="color:red"&gt;Type&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;Text&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;test&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;FieldRef&lt;/span&gt; &lt;span style="color:red"&gt;Name&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;Title2&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt; &lt;span style="color:red"&gt;Type&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;Text&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;test&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Or&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;FieldRef&lt;/span&gt; &lt;span style="color:red"&gt;Name&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;Note1&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt; &lt;span style="color:red"&gt;Type&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;Note&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;test&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Or&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;FieldRef&lt;/span&gt; &lt;span style="color:red"&gt;Name&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;Note2&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt; &lt;span style="color:red"&gt;Type&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;Note&lt;/span&gt;&lt;span style="color:black"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;test&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
  &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Or&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Where&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;But then we have another problem: currently in Camlex method Contains is defined only for types which inherit DataTypes.StringBasedFieldType. There are only 2 such types: DataTypes.Text and DataTypes.Note. And it is quite logical, because Contains and BeginWith
 methods are used with strings. I don't think we want to change it. However you may get source code and change it by yourself: inherit DataTypes.Choice and DataTypes.User from DataTypes.StringBasedFieldType and then use my example.&lt;/p&gt;
&lt;p&gt;Another way is to convert Caml query to xml using ToCaml() method and change type attribute using linq2xml.&lt;/p&gt;
&lt;p&gt;About another your questions:&lt;/p&gt;
&lt;p&gt;a. If I understood your question correctly yes it is possible starting from 3.2 version where we implemented support of adding dynamic conditions to existing string queries. You can find examples here:
&lt;a href="http://sadomovalex.blogspot.fi/2012/06/camlexnet-32-add-expressions-to.html"&gt;
http://sadomovalex.blogspot.fi/2012/06/camlexnet-32-add-expressions-to.html&lt;/a&gt;. However if you just have list of conditions and want to add more conditions to it you can do that by the same way as in the example above.&lt;/p&gt;
&lt;p&gt;b. No, In clause is not supported yet (Camlex was created for Sharepoint 2007, while In clause was introduced in Sharepoint 2010. But we still want to have compatibility. For implementing it I most probably will create separate branch for Sharepoint 2007,
 while branch for Sharepoint 2010 will be used as base), but it will be next feature which I'm going to implement.&lt;/p&gt;
&lt;/div&gt;</description><author>sadomovalex</author><pubDate>Tue, 15 Jan 2013 20:37:47 GMT</pubDate><guid isPermaLink="false">New Post: Dynamic Caml expression - Contains clause 20130115083747P</guid></item><item><title>New Post: Dynamic Caml expression - Contains clause</title><link>http://camlex.codeplex.com/discussions/429673</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;First of all thanks for building such a great tool and making life easy. I need some help in building a dynamic Contains query.&lt;/p&gt;
&lt;p&gt;I'm building a dynamic caml expression for searching a list on multiple columns. User would type a text and select one or more columns from the list. Columns can be of type text, note, Choice, lookup, User etc. Entered text should be searched on all these
 columns.&lt;/p&gt;
&lt;p&gt;I see that there's no way to specify column type while building a Contains expression.&lt;/p&gt;
&lt;p&gt;for e.g. the below code treats all columns to be of type text&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;List&amp;lt;Expression&amp;lt;Func&amp;lt;SPListItem, &lt;span style="color:blue"&gt;bool&lt;/span&gt;&amp;gt;&amp;gt;&amp;gt; searchConditions = &lt;span style="color:blue"&gt;null&lt;/span&gt;;
&lt;span style="color:blue"&gt;if&lt;/span&gt; (!&lt;span style="color:blue"&gt;string&lt;/span&gt;.IsNullOrEmpty(searchText) &amp;&amp; searchFields != &lt;span style="color:blue"&gt;null&lt;/span&gt;)
{
    searchConditions = &lt;span style="color:blue"&gt;new&lt;/span&gt; List&amp;lt;Expression&amp;lt;Func&amp;lt;SPListItem, &lt;span style="color:blue"&gt;bool&lt;/span&gt;&amp;gt;&amp;gt;&amp;gt;();
    f&lt;span style="color:blue"&gt;oreach&lt;/span&gt; (SearchField searchField &lt;span style="color:blue"&gt;in&lt;/span&gt; searchFields)
    {
         &lt;span style="color:blue"&gt;string&lt;/span&gt; fieldName = searchField.FieldName;
         searchConditions.Add(x =&amp;gt; ((&lt;span style="color:blue"&gt;string&lt;/span&gt;)x[fieldName]).Contains(searchText));
    }
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Suppose I am searching on 3 columns - Title(Text), Brand(Lookup) and Created By(User), using a Or query I'll get this caml query generated&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Where&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Or&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
       &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;FieldRef&lt;/span&gt; &lt;span style="color:red"&gt;Name&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;quot;Title&amp;quot;&lt;/span&gt; &lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt; &lt;span style="color:red"&gt;Type&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;quot;Text&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Some text&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
       &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
       &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Or&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
             &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;FieldRef&lt;/span&gt; &lt;span style="color:red"&gt;Name&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;quot;Brand&amp;quot;&lt;/span&gt; &lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;
             &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt; &lt;span style="color:red"&gt;Type&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;quot;Text&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Some text&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
             &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;FieldRef&lt;/span&gt; &lt;span style="color:red"&gt;Name&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;quot;Author&amp;quot;&lt;/span&gt; &lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;
             &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt; &lt;span style="color:red"&gt;Type&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;quot;Text&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Some text&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Or&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Or&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Where&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In the query above, everywhere column type is &amp;quot;Text&amp;quot;. Is it possible to get the actual types as below? Is there any downside if I go with the above?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Where&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Or&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
       &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;FieldRef&lt;/span&gt; &lt;span style="color:red"&gt;Name&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;quot;Title&amp;quot;&lt;/span&gt; &lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt; &lt;span style="color:red"&gt;Type&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;quot;Text&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Some text&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
       &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
       &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Or&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
             &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;FieldRef&lt;/span&gt; &lt;span style="color:red"&gt;Name&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;quot;Brand&amp;quot;&lt;/span&gt; &lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;
             &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt; &lt;span style="color:red"&gt;Type&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;quot;Choice&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Some text&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
             &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;FieldRef&lt;/span&gt; &lt;span style="color:red"&gt;Name&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;quot;Author&amp;quot;&lt;/span&gt; &lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;
             &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt; &lt;span style="color:red"&gt;Type&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;quot;User&amp;quot;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Some text&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Value&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
          &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Contains&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Or&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Or&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Where&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Any help is much appreciated.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Rajesh&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description><author>rjn71</author><pubDate>Tue, 15 Jan 2013 14:13:11 GMT</pubDate><guid isPermaLink="false">New Post: Dynamic Caml expression - Contains clause 20130115021311P</guid></item><item><title>New Post: Why do I get "not supported " exception in the 2nd block of code</title><link>http://camlex.codeplex.com/discussions/403446</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;senglory hi,&lt;/p&gt;
&lt;p&gt;in CAML there are no options for specifying should query be case sensitive or not. Camlex is a tool which simplifies creation of CAML queries, but it doesn't extends the CAML. I.e. all limitations of CAML are still here. So your 2nd syntax is not correct.&lt;/p&gt;
&lt;p&gt;By default CAML queries are case insensitive and you don't need to do extra steps for this. If it doesn't in your case (otherwise you would not worry about that I guess), then probably collation of your content database was changed from CI (case insensitive)
 to CS (case sensitive). You should investigate the reasons of this.&lt;/p&gt;
&lt;p&gt;More often people ask how to make search via SPQuery case sensitive. In order to do that you have to retrieve items using case insensitive CAML and then additionally filter them in memory.&lt;/p&gt;
&lt;/div&gt;</description><author>sadomovalex</author><pubDate>Fri, 16 Nov 2012 12:29:07 GMT</pubDate><guid isPermaLink="false">New Post: Why do I get "not supported " exception in the 2nd block of code 20121116122907P</guid></item><item><title>New Post: Why do I get "not supported " exception in the 2nd block of code</title><link>http://camlex.codeplex.com/discussions/403446</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;                        &lt;span style="color:blue"&gt;var&lt;/span&gt; lst2 = web.Lists[&lt;span style="color:#a31515"&gt;&amp;quot;&amp;#1042;&amp;#1080;&amp;#1076;&amp;#1099; &amp;#1076;&amp;#1086;&amp;#1082;&amp;#1091;&amp;#1084;&amp;#1077;&amp;#1085;&amp;#1090;&amp;#1086;&amp;#1074;&amp;quot;&lt;/span&gt;];
                        &lt;span style="color:blue"&gt;var&lt;/span&gt; nameFieldName = lst2.Fields[&lt;span style="color:#a31515"&gt;&amp;quot;&amp;#1053;&amp;#1072;&amp;#1079;&amp;#1074;&amp;#1072;&amp;#1085;&amp;#1080;&amp;#1077;&amp;quot;&lt;/span&gt;].InternalName;
                        &lt;span style="color:blue"&gt;var&lt;/span&gt; name1 = &lt;span style="color:#a31515"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;
                        SPQuery search;
                        &lt;span style="color:blue"&gt;string&lt;/span&gt; caml1;

                        name1 = &lt;span style="color:#a31515"&gt;&amp;quot;&amp;#1048;&amp;#1079;&amp;#1084;&amp;#1077;&amp;#1085;&amp;#1077;&amp;#1085;&amp;#1080;&amp;#1077; &amp;#1073;&amp;#1072;&amp;#1085;&amp;#1082;&amp;#1086;&amp;#1074;&amp;#1089;&amp;#1082;&amp;#1080;&amp;#1093; &amp;#1088;&amp;#1077;&amp;#1082;&amp;#1074;&amp;#1080;&amp;#1079;&amp;#1080;&amp;#1090;&amp;#1086;&amp;#1074; &amp;#1082;&amp;#1086;&amp;#1085;&amp;#1090;&amp;#1088;&amp;#1072;&amp;#1075;&amp;#1077;&amp;#1085;&amp;#1090;&amp;#1072;&amp;quot;&lt;/span&gt;;
                        caml1 = Camlex.Query().Where(x =&amp;gt; ((&lt;span style="color:blue"&gt;string&lt;/span&gt;)x[nameFieldName]) == name1).ToString();

&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This code works fine, no run-time exceptions. But this:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;                        &lt;span style="color:blue"&gt;var&lt;/span&gt; lst2 = web.Lists[&lt;span style="color:#a31515"&gt;&amp;quot;&amp;#1042;&amp;#1080;&amp;#1076;&amp;#1099; &amp;#1076;&amp;#1086;&amp;#1082;&amp;#1091;&amp;#1084;&amp;#1077;&amp;#1085;&amp;#1090;&amp;#1086;&amp;#1074;&amp;quot;&lt;/span&gt;];
                        &lt;span style="color:blue"&gt;var&lt;/span&gt; nameFieldName = lst2.Fields[&lt;span style="color:#a31515"&gt;&amp;quot;&amp;#1053;&amp;#1072;&amp;#1079;&amp;#1074;&amp;#1072;&amp;#1085;&amp;#1080;&amp;#1077;&amp;quot;&lt;/span&gt;].InternalName;
                        &lt;span style="color:blue"&gt;var&lt;/span&gt; name1 = &lt;span style="color:#a31515"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;
                        SPQuery search;
                        &lt;span style="color:blue"&gt;string&lt;/span&gt; caml1;

                        name1 = &lt;span style="color:#a31515"&gt;&amp;quot;&amp;#1048;&amp;#1079;&amp;#1084;&amp;#1077;&amp;#1085;&amp;#1077;&amp;#1085;&amp;#1080;&amp;#1077; &amp;#1073;&amp;#1072;&amp;#1085;&amp;#1082;&amp;#1086;&amp;#1074;&amp;#1089;&amp;#1082;&amp;#1080;&amp;#1093; &amp;#1088;&amp;#1077;&amp;#1082;&amp;#1074;&amp;#1080;&amp;#1079;&amp;#1080;&amp;#1090;&amp;#1086;&amp;#1074; &amp;#1082;&amp;#1086;&amp;#1085;&amp;#1090;&amp;#1088;&amp;#1072;&amp;#1075;&amp;#1077;&amp;#1085;&amp;#1090;&amp;#1072;&amp;quot;&lt;/span&gt;;
                        caml1 = Camlex.Query().Where(x =&amp;gt; ((&lt;span style="color:blue"&gt;string&lt;/span&gt;)x[nameFieldName]).ToUpper() == name1.ToUpper()).ToString();

&lt;/pre&gt;
&lt;/div&gt;
tells me something unclear about incorrect syntax or similar. I wonder why and how to have case-insensitive strings comparison in Camlex?
&lt;p&gt;&lt;/p&gt;
&lt;/div&gt;</description><author>senglory</author><pubDate>Fri, 16 Nov 2012 08:14:50 GMT</pubDate><guid isPermaLink="false">New Post: Why do I get "not supported " exception in the 2nd block of code 20121116081450A</guid></item></channel></rss>