1

Closed

Multiple Where clauses on IQuery object are not supported ?

description

The following query with 2 'Where' clauses:
string xml = Camlex.Query()
.Where(x => ((string)x["Title"]).Contains("Visual"))
.Where(x => ((DateTime)x["Created"]) > new DateTime(2010, 09, 01))
.ToString();
creates an XML string containing only the last Where which is not correct!
<Query><Where><Gt><FieldRef Name=\"Created\" /><Value Type=\"DateTime\">2010-09-01T00:00:00Z</Value></Gt></Where></Query>

It should be:
<Query><Where><And><Gt><FieldRef Name=\"Created\" /><Value Type=\"DateTime\">2010-09-01T00:00:00Z</Value></Gt><Contains><FieldRef Name=\"Title\" /><Value Type=\"Text\">Visual</Value></Contains></And></Where></Query>

Please fix this





int[] data = new int[] { 1, 3, 5, 10 };

int[] data2 = data
.Where(i => i < 5)
.Where(i => i > 1)
.ToArray();
// data2[0] = 3
data2.Dump();
Closed Dec 15, 2012 at 6:31 PM by sadomovalex

comments

stefh wrote Aug 1, 2012 at 7:39 PM