Open
Description
I am trying to follow the tutorial and wanted to peek at the finished code to make sure I put the IEnumerable Suits() in the right place. It was unclear to me if it should be inside the public class Program or not. But when I went to the sample code, I found it does not look at all like the tutorial. Instead of the IEnumerable type, I see enum types used.
Sample code location:
https://github.com/dotnet/samples/blob/main/csharp/getting-started/console-linq/Program.cs
Code I expected to see:
static IEnumerable<string> Suits()
{
yield return "clubs";
yield return "diamonds";
yield return "hearts";
yield return "spades";
}
Code I found in the sample source code Github repository (Program.cs
):
public enum Suit
{
Clubs,
Diamonds,
Hearts,
Spades
}
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 5a2b7453-076c-a18e-f999-cbd57ab13e60
- Version Independent ID: b687ed5b-5013-cceb-01e5-77f9cc7bb534
- Content: Working with LINQ
- Content Source: docs/csharp/tutorials/working-with-linq.md
- Product: dotnet-csharp
- Technology: csharp-linq
- GitHub Login: @BillWagner
- Microsoft Alias: wiwagn