Skip to content

Commit 2f05eac

Browse files
authored
Add empty classes into the docs example (#29790)
* Remove note In favor of updating the example along with the note. * Add empty classes to Program.cs file * Remove separate files for empty classes * update example highlight to include additional empty classes and comment
1 parent 521416c commit 2f05eac

File tree

25 files changed

+35
-138
lines changed

25 files changed

+35
-138
lines changed

docs/csharp/programming-guide/concepts/async/index.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,12 @@ For a parallel algorithm, you'd need multiple cooks (or threads). One would make
2525

2626
Now, consider those same instructions written as C# statements:
2727

28-
:::code language="csharp" source="snippets/index/AsyncBreakfast-starter/Program.cs" highlight="8-27":::
28+
:::code language="csharp" source="snippets/index/AsyncBreakfast-starter/Program.cs" highlight="8-34":::
2929

3030
:::image type="content" source="media/synchronous-breakfast.png" alt-text="synchronous breakfast":::
3131

3232
The synchronously prepared breakfast took roughly 30 minutes because the total is the sum of each task.
3333

34-
> [!NOTE]
35-
> The `Coffee`, `Egg`, `Bacon`, `Toast`, and `Juice` classes are empty. They are simply marker classes for the purpose of demonstration, contain no properties, and serve no other purpose.
36-
3734
Computers don't interpret those instructions the same way people do. The computer will block on each statement until the work is complete before moving on to the next statement. That creates an unsatisfying breakfast. The later tasks wouldn't be started until the earlier tasks had been completed. It would take much longer to create the breakfast, and some items would have gotten cold before being served.
3835

3936
If you want the computer to execute the above instructions asynchronously, you must write asynchronous code.

docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V2/Bacon.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V2/Coffee.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V2/Egg.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V2/Juice.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V2/Program.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ namespace AsyncBreakfast
66
class Program
77
{
88
// <SnippetMain>
9+
// These classes are intentionally empty for the purpose of this example. They are simply marker classes for the purpose of demonstration, contain no properties, and serve no other purpose.
10+
internal class Bacon { }
11+
internal class Coffee { }
12+
internal class Egg { }
13+
internal class Juice { }
14+
internal class Toast { }
15+
916
static async Task Main(string[] args)
1017
{
1118
Coffee cup = PourCoffee();

docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V2/Toast.cs

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V3/Bacon.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V3/Coffee.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V3/Egg.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)