Skip to main content

I used Camlex function "WhereAny"

public string exp(string t)
    {
        var expressions = new List<Expression<Func<SPListItem, bool>>>();
        string token = t;
        //expressions.Add(x => ((string)x["ContentType"]).Contains("Document"));
        expressions.Add(x => ((string)x["Area"]).Contains(token));
        expressions.Add(x => ((string)x["TypeOfDoc"]).Contains(token));
        expressions.Add(x => ((string)x["Category"]).Contains(token));
        expressions.Add(x => ((string)x["Tags"]).Contains(token));
        expressions.Add(x => ((string)x["CustomerName"]).Contains(token));
        expressions.Add(x => ((string)x["Comments"]).Contains(token));
        expressions.Add(x => ((string)x["SubTypeOfDoc"]).Contains(token));
        expressions.Add(x => ((string)x["runTimeFolder"]).Contains(token));
        expressions.Add(x => ((string)x["Country"]).Contains(token));

        // prepare query
        string caml = Camlex.Query().WhereAny(expressions).ToString();
        return caml;
    }

theThe above function returned me a CAML query. And that query is fired over the DocumntDocument Library, result is stored in DataTable and displayed.

I used Camlex function "WhereAny"

public string exp(string t)
    {
        var expressions = new List<Expression<Func<SPListItem, bool>>>();
        string token = t;
        //expressions.Add(x => ((string)x["ContentType"]).Contains("Document"));
        expressions.Add(x => ((string)x["Area"]).Contains(token));
        expressions.Add(x => ((string)x["TypeOfDoc"]).Contains(token));
        expressions.Add(x => ((string)x["Category"]).Contains(token));
        expressions.Add(x => ((string)x["Tags"]).Contains(token));
        expressions.Add(x => ((string)x["CustomerName"]).Contains(token));
        expressions.Add(x => ((string)x["Comments"]).Contains(token));
        expressions.Add(x => ((string)x["SubTypeOfDoc"]).Contains(token));
        expressions.Add(x => ((string)x["runTimeFolder"]).Contains(token));
        expressions.Add(x => ((string)x["Country"]).Contains(token));

        // prepare query
        string caml = Camlex.Query().WhereAny(expressions).ToString();
        return caml;
    }

the above function returned me a CAML query. And that query is fired over the Documnt Library, result stored in DataTable and displayed.

I used Camlex function "WhereAny"

public string exp(string t)
    {
        var expressions = new List<Expression<Func<SPListItem, bool>>>();
        string token = t;
        //expressions.Add(x => ((string)x["ContentType"]).Contains("Document"));
        expressions.Add(x => ((string)x["Area"]).Contains(token));
        expressions.Add(x => ((string)x["TypeOfDoc"]).Contains(token));
        expressions.Add(x => ((string)x["Category"]).Contains(token));
        expressions.Add(x => ((string)x["Tags"]).Contains(token));
        expressions.Add(x => ((string)x["CustomerName"]).Contains(token));
        expressions.Add(x => ((string)x["Comments"]).Contains(token));
        expressions.Add(x => ((string)x["SubTypeOfDoc"]).Contains(token));
        expressions.Add(x => ((string)x["runTimeFolder"]).Contains(token));
        expressions.Add(x => ((string)x["Country"]).Contains(token));

        // prepare query
        string caml = Camlex.Query().WhereAny(expressions).ToString();
        return caml;
    }

The above function returned me a CAML query. And that query is fired over the Document Library, result is stored in DataTable and displayed.

Source Link
ankit
  • 51
  • 8

I used Camlex function "WhereAny"

public string exp(string t)
    {
        var expressions = new List<Expression<Func<SPListItem, bool>>>();
        string token = t;
        //expressions.Add(x => ((string)x["ContentType"]).Contains("Document"));
        expressions.Add(x => ((string)x["Area"]).Contains(token));
        expressions.Add(x => ((string)x["TypeOfDoc"]).Contains(token));
        expressions.Add(x => ((string)x["Category"]).Contains(token));
        expressions.Add(x => ((string)x["Tags"]).Contains(token));
        expressions.Add(x => ((string)x["CustomerName"]).Contains(token));
        expressions.Add(x => ((string)x["Comments"]).Contains(token));
        expressions.Add(x => ((string)x["SubTypeOfDoc"]).Contains(token));
        expressions.Add(x => ((string)x["runTimeFolder"]).Contains(token));
        expressions.Add(x => ((string)x["Country"]).Contains(token));

        // prepare query
        string caml = Camlex.Query().WhereAny(expressions).ToString();
        return caml;
    }

the above function returned me a CAML query. And that query is fired over the Documnt Library, result stored in DataTable and displayed.