Skip to content

Commit 6164085

Browse files
authored
pull base content,head:MicrosoftDocs:main,into:wwlpublishsync
2 parents 899ec4f + dba14ba commit 6164085

9 files changed

+31
-20
lines changed

learn-pr/wwl-language/csharp-code-blocks/1-introduction.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Introduction
44
metadata:
55
title: Introduction
66
description: "Introduction"
7-
ms.date: 11/06/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-code-blocks/2-exercise-variable-scope.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Exercise - Code blocks and variable scope
44
metadata:
55
title: Exercise - Code blocks and variable scope
66
description: "Exercise - Code blocks and variable scope"
7-
ms.date: 11/06/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-code-blocks/3-exercise-remove-if-statements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Exercise - Remove code blocks from if statements
44
metadata:
55
title: Exercise - Remove code blocks from if statements
66
description: "Exercise - Remove code blocks from if statements"
7-
ms.date: 11/06/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-code-blocks/4-exercise-challenge-variable-scope.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Exercise - Complete a challenge activity using variable scope
44
metadata:
55
title: Exercise - Complete a challenge activity using variable scope
66
description: "Exercise - Complete a challenge activity using variable scope"
7-
ms.date: 11/06/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-code-blocks/5-review-solution-variable-scope.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Review the solution to the variable scope challenge activity
44
metadata:
55
title: Review the solution to the variable scope challenge activity
66
description: "Review the solution to the variable scope challenge activity"
7-
ms.date: 11/06/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-code-blocks/6-knowledge-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Module assessment
44
metadata:
55
title: Module assessment
66
description: "Knowledge check"
7-
ms.date: 11/06/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-code-blocks/7-summary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Summary
44
metadata:
55
title: Summary
66
description: "Summary"
7-
ms.date: 11/06/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-code-blocks/includes/2-exercise-variable-scope.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,32 @@ This module includes hands-on activities that guide you through the process of b
3333

3434
Notice that a command prompt in the Terminal panel displays the folder path for the current folder. For example:
3535

36-
```dos
36+
```PowerShell
3737
C:\Users\someuser\Desktop>
3838
```
3939
4040
> [!NOTE]
4141
> If you are working on your own PC rather than in a sandbox or hosted environment and you have completed other Microsoft Learn modules in this C# series, you may have already created a project folder for code samples. If that's the case, you can skip over the next step, which is used to create a console app in the TestProject folder.
4242
43-
1. At the Terminal command prompt, to create a new console application in a specified folder, type **dotnet new console -o ./CsharpProjects/TestProject** and then press Enter.
43+
1. At the Terminal command prompt, to create a new console application in a specified folder, enter the following prompt:
44+
45+
```dotnetcli
46+
dotnet new console -o ./CsharpProjects/TestProject
47+
```
4448
4549
This .NET CLI command uses a .NET program template to create a new C# console application project in the specified folder location. The command creates the CsharpProjects and TestProject folders for you, and uses TestProject as the name of your `.csproj` file.
4650
47-
1. In the EXPLORER panel, expand the **CsharpProjects** folder.
51+
If a message is displayed telling you that the files already exist, continue with the next steps. You'll reuse the existing project files.
52+
53+
1. In the EXPLORER view, expand the **CsharpProjects** folder.
54+
55+
You should see the **TestProject** folder and two files, a C# program file named Program.cs and a C# project file named TestProject.csproj.
56+
57+
1. On the Visual Studio Code **File** menu, select **Open Folder**.
4858
49-
You should see the TestProject folder and two files, a C# program file named Program.cs and a C# project file named TestProject.csproj.
59+
1. In the **Open Folder** dialog, select the **CsharpProjects** folder, and then select **Select Folder**.
5060
51-
1. In the EXPLORER panel, to view your code file in the Editor panel, select **Program.cs**.
61+
1. In the EXPLORER view, expand the TestProject folder, and then select **Program.cs**.
5262
5363
1. Delete the existing code lines.
5464

learn-pr/wwl-language/csharp-code-blocks/index.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
### YamlMime:Module
22
uid: learn.languages.csharp-code-blocks
33
metadata:
4-
title: Control variable scope and logic using code blocks in C#
4+
title: Control Variable Scope and Logic using Code Blocks in C#
55
description: "Use code blocks with more confidence, understanding how they impact the visibility and accessibility of both higher and lower-level constructs in your code."
6-
ms.date: 11/06/2024
6+
ms.date: 06/16/2025
77
author: wwlpublish
88
ms.author: cahowd
99
ms.topic: module
10+
ms.collection: N/A
1011
ms.custom:
1112
- N/A
1213
ms.service: dotnet-csharp
@@ -17,17 +18,17 @@ summary: Use code blocks with more confidence, understanding how they impact the
1718
abstract: |
1819
After you complete this module, you'll be able to:
1920
20-
- Understand the impact of declaring and initializing variables inside and outside of code blocks
21+
- Understand the impact of declaring and initializing variables inside and outside of code blocks.
2122
22-
- Remove code blocks in if statements to improve readability when there's only one line of code in the body of the code block
23+
- Remove code blocks in if statements to improve readability when there's only one line of code in the body of the code block.
2324
24-
- Describe the purpose and scoping hierarchy for namespaces, classes, and methods
25+
- Describe the purpose and scoping hierarchy for namespaces, classes, and methods.
2526
prerequisites: |
26-
- Experience creating simple C# applications that include console I/O and access the methods of .NET classes such as String and Random
27+
- Experience creating simple C# applications that include console I/O and access the methods of .NET classes such as String and Random.
2728
28-
- Experience using Visual Studio Code to develop, build, and run C# console applications that implement arrays, if-elseif-else statements, and foreach statements
29+
- Experience using Visual Studio Code to develop, build, and run C# console applications that implement arrays, if-elseif-else statements, and foreach statements.
2930
30-
- Experience using operators to evaluate an expression or condition in C#
31+
- Experience using operators to evaluate an expression or condition in C#.
3132
iconUrl: /training/achievements/csharp-code-blocks.svg
3233
levels:
3334
- beginner

0 commit comments

Comments
 (0)