0
Answer

Linq 'where' and 'and' not working??

Alex Brown

Alex Brown

16y
15.1k
1

Hi,

I have this linq statement:

IEnumerable<Room> roomsList = (from room in parent.Descendants("room")
where room.Element("sleeps").Value == "2"
&& room.Element("rate").Element("price").Value != "Full"

the 'parent' bit above is an XElement -

http://xmlfeed.laterooms.com/index.aspx?aid=3998&rtype=7&sdate=2008-07-22&nights=4&hids=149455,124561,4851,92536,85964,121511,7456,3244,142397,87208,145391,145340,88026,147544,91385,71752,73224,4721,1393,100204,93523,72858,69789,149598,86922,149596,89064,73453,84151,72996,66188,100294,100434

from the above ^^

Basically, i want roomsList to have only those rooms, that do not have a price that is "Full"
However, in teh roomsList, there are still "Full" values!!

where am i going wrong?

Alex

 

Next Recommended Forum