Possible Duplicates:
Which LINQ syntax do you prefer? Fluent or Query Expression LINQ: Dot Notation vs Query Expression
What is the difference between the two methods of sorting in Linq? Is one better than the other performance wise?
The query syntax is syntactical sugar that gets converted to the method approach. There's no difference, use whatever style suits your needs.
From the LINQ Query Syntax versus Method Syntax MSDN article:
there is no semantic difference between method syntax and query syntax. In addition, some queries, such as those that retrieve the number of elements that match a specified condition, or that retrieve the element that has the maximum value in a source sequence, can only be expressed as method calls.
精彩评论