What is the difference between these 2 XML LINQ Queries?

Posted by Jon on Stack Overflow See other posts from Stack Overflow or by Jon
Published on 2010-03-08T10:43:50Z Indexed on 2010/03/08 10:51 UTC
Read the original article Hit count: 229

Filed under:
|
|
|

I have the 2 following LINQ queries and I haven't quite got my head around LINQ so what is the difference between the 2 approaches below?

Is there a circumstance where one approach is better than another?

ChequeDocument.Descendants("ERRORS").Where(x=>(string)x.Attribute("D") == "").Count();

    (from x in ChequeDocument.Descendants("ERRORS") where
                            (string)x.Attribute("D") == ""
                            select x).Count())

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about linq-to-xml