dotnet / dotnet/docs

Sample code on Github does not match the tutorial code

Open
#28,865 1 comment 0 reactions 0 assignees View on GitHub
:bomb: vanQUEST :pushpin: seQUESTered csharp-linq/subsvc dotnet-csharp/svc in-pr okr-quality
Dominant language
No language data
Stars
4.8k
Forks
6.1k
Avg merge
19h 10m
Merged PRs (30d)
268

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:

Code I expected to see:
```csharp
static IEnumerable 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`):
```csharp
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](https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/working-with-linq)
* Content Source: [docs/csharp/tutorials/working-with-linq.md](https://github.com/dotnet/docs/blob/main/docs/csharp/tutorials/working-with-linq.md)
* Product: **dotnet-csharp**
* Technology: **csharp-linq**
* GitHub Login: @BillWagner
* Microsoft Alias: **wiwagn**

---
[Associated WorkItem - 476422](https://dev.azure.com/msft-skilling/Content/_workitems/edit/476422)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.