Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/csharp/tutorials/working-with-linq.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ The multiple `from` clauses produce a <xref:System.Linq.Enumerable.SelectMany%2A

It's important to keep in mind that whether you choose to write your LINQ in the query syntax used above or use method syntax instead, it's always possible to go from one form of syntax to the other. The above query written in query syntax can be written in method syntax as:
```csharp
var startingDeck = Suits().SelectMany(suit => Ranks(rank => new { Suit = suit, Rank = rank }));
var startingDeck = Suits().SelectMany(suit => Ranks().Select(rank => new { Suit = suit, Rank = rank }));
```
The compiler translates LINQ statements written with query syntax into the equivalent method call syntax. Therefore, regardless of your syntax choice, the two versions of the query produce the same result. Choose which syntax works best for your situation: for instance, if you're working in a team where some of the members have difficulty with method syntax, try to prefer using query syntax.

Expand Down Expand Up @@ -339,4 +339,4 @@ For more information on LINQ, see:
- [Basic LINQ Query Operations (C#)](../programming-guide/concepts/linq/basic-linq-query-operations.md)
- [Data Transformations With LINQ (C#)](../programming-guide/concepts/linq/data-transformations-with-linq.md)
- [Query Syntax and Method Syntax in LINQ (C#)](../programming-guide/concepts/linq/query-syntax-and-method-syntax-in-linq.md)
- [C# Features That Support LINQ](../programming-guide/concepts/linq/features-that-support-linq.md)
- [C# Features That Support LINQ](../programming-guide/concepts/linq/features-that-support-linq.md)