Skip to content

Commit 76d124a

Browse files
committed
Update edited articles per templates
Apply the current template styles to all impacted articles in this PR.
1 parent 829dae5 commit 76d124a

7 files changed

Lines changed: 44 additions & 27 deletions

File tree

docfx.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@
252252
"docs/core/unmanaged-api/**/*.md": "reference",
253253
"docs/core/whats-new/**/*.md": "whats-new",
254254
"docs/csharp/advanced-topics/interface-implementation/**.md": "tutorial",
255+
"docs/csharp/fundamentals/program-structure/**.md": "concept-article",
255256
"docs/csharp/getting-started/**/*.md": "overview",
256257
"docs/csharp/how-to/**/*.md": "how-to",
257258
"docs/csharp/language-reference/**/*.md": "language-reference",

docs/csharp/fundamentals/program-structure/index.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
---
22
title: "General structure of a C# program"
33
description: Learn how C# programs are structured, including the choice between file-based and project-based apps, top-level statements and Main method entry points, and the building blocks that make up every program.
4-
ms.date: 03/13/2026
4+
ms.date: 03/16/2026
5+
ms.topic: concept-article
56
ai-usage: ai-assisted
7+
8+
#customer intent: As a C# developer, I want to understand how C# programs are structured so that I can choose the right application style and organize my code effectively.
9+
610
---
711
# General structure of a C# program
812

@@ -108,17 +112,12 @@ var f = Math.Max(a, b) + Math.Max(c, d);
108112

109113
For detailed information about statements, see [Statements](../../programming-guide/statements-expressions-operators/statements.md). For information about expression-bodied members, see [Expression-bodied members](../../programming-guide/statements-expressions-operators/expression-bodied-members.md).
110114

111-
## Related sections
112-
113-
Learn about these program elements in the [types](../types/index.md) section of the fundamentals guide:
115+
## Related content
114116

115117
- [Classes](../types/classes.md)
116118
- [Structs](../../language-reference/builtin-types/struct.md)
117119
- [Namespaces](namespaces.md)
118120
- [Interfaces](../types/interfaces.md)
119121
- [Enums](../../language-reference/builtin-types/enum.md)
120122
- [Delegates](../../delegates-overview.md)
121-
122-
## C# language specification
123-
124-
For more information, see [Basic concepts](~/_csharpstandard/standard/basic-concepts.md) in the [C# Language Specification](~/_csharpstandard/standard/README.md). The language specification is the definitive source for C# syntax and usage.
123+
- [Basic concepts in the C# language specification](~/_csharpstandard/standard/basic-concepts.md)

docs/csharp/fundamentals/program-structure/main-command-line.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
title: "Main() and command-line arguments"
33
description: Learn about Main() and command-line arguments. The 'Main' method is the entry point of an executable program.
4-
ms.date: 03/13/2026
4+
ms.date: 03/16/2026
5+
ai-usage: ai-assisted
6+
#customer intent: As a C# developer, I want to understand the Main() method and command-line arguments so that I can define and control the entry point of my application.
57
---
68
# Main() and command-line arguments
79

@@ -89,7 +91,7 @@ For a working example, see [How to display command-line arguments](../tutorials/
8991

9092
[!INCLUDE[CSharplangspec](~/includes/csharplangspec-md.md)]
9193

92-
## See also
94+
## Related content
9395

9496
- <xref:System.Environment?displayProperty=nameWithType>
9597
- [How to display command line arguments](../tutorials/how-to-display-command-line-arguments.md)

docs/csharp/fundamentals/program-structure/namespaces.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
---
22
title: "Namespaces and using directives"
33
description: Learn how to organize C# code with namespaces, file-scoped namespace declarations, global usings, static usings, and type aliases.
4-
ms.date: 03/13/2026
4+
ms.date: 03/16/2026
55
ai-usage: ai-assisted
6+
7+
#customer intent: As a C# developer, I want to understand namespaces and using directives so that I can organize my types and simplify how I reference them in code.
8+
69
---
710
# Namespaces and using directives
811

@@ -90,6 +93,7 @@ Starting with C# 12, you can alias any type, including tuples and pointer types:
9093

9194
For more advanced scenarios where two assemblies define the same fully qualified type name, use [extern alias](../../language-reference/keywords/extern-alias.md) to disambiguate between them.
9295

93-
## C# language specification
96+
## Related content
9497

95-
For more information, see the [Namespaces](~/_csharpstandard/standard/namespaces.md) section of the [C# language specification](~/_csharpstandard/standard/README.md).
98+
- [`using` directive (language reference)](../../language-reference/keywords/using-directive.md)
99+
- [Namespaces in the C# language specification](~/_csharpstandard/standard/namespaces.md)

docs/csharp/fundamentals/program-structure/preprocessor-directives.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
---
22
title: "Preprocessor directives"
3-
description: Learn how to use the most common C# preprocessor directives—conditional compilation, regions, nullable context control, and warning suppression—in everyday development.
4-
ms.date: 03/13/2026
3+
description: Learn how to use the most common C# preprocessor directives—conditional compilation, regions, and warning suppression—in everyday development.
4+
ms.date: 03/16/2026
55
ai-usage: ai-assisted
6+
7+
#customer intent: As a C# developer, I want to understand preprocessor directives so that I can control conditional compilation, configure file-based apps, and manage compiler warnings.
8+
69
---
710
# Preprocessor directives
811

@@ -16,7 +19,6 @@ C# preprocessor directives tell the compiler what code to include, exclude, or t
1619
- **File-based apps** (`#:`) - configure file-based apps.
1720
- **Conditional compilation** (`#if` / `#elif` / `#else` / `#endif`) — include or exclude code based on build configuration or target framework.
1821
- **Warning suppression** (`#pragma warning`) — suppress or restore specific compiler warnings.
19-
- **Nullable context** (`#nullable`) — control nullable reference type analysis at a fine-grained level.
2022

2123
## File-based app directives
2224

@@ -73,6 +75,7 @@ Use `#pragma warning disable` to suppress specific compiler warnings, and `#prag
7375
> [!TIP]
7476
> Always specify the warning number, such as `CS0168`, rather than disabling all warnings. This approach keeps the suppression targeted and makes it clear *why* a warning is being suppressed.
7577
76-
## See also
78+
## Related content
7779

78-
- [C# preprocessor directives (language reference)](../../language-reference/preprocessor-directives.md) — complete reference for all preprocessor directives.
80+
- [C# preprocessor directives (language reference)](../../language-reference/preprocessor-directives.md)
81+
- [File-based apps](../../../core/sdk/file-based-apps.md)

docs/csharp/fundamentals/program-structure/program-organization.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
---
22
title: "Program organization"
33
description: Learn how to organize C# programs using solutions, projects, assemblies, namespaces, and types to build maintainable, well-structured applications.
4-
ms.date: 03/13/2026
4+
ms.date: 03/16/2026
55
ai-usage: ai-assisted
6+
7+
#customer intent: As a C# developer, I want to understand how to organize my code using solutions, projects, assemblies, and namespaces so that I can build maintainable applications.
8+
69
---
710
# Program organization
811

@@ -85,8 +88,8 @@ Default to `internal` for types that other projects don't need. This practice hi
8588
- **Use `global using` directives.** Place common imports in a `GlobalUsings.cs` file to eliminate repetitive `using` lines across files. For more information, see [Namespaces and using directives](namespaces.md).
8689
- **Default to `internal`.** Only mark types `public` when other assemblies genuinely need them. You can always widen access later; narrowing it is a breaking change.
8790

88-
## See also
91+
## Related content
8992

90-
- [Namespaces and using directives](namespaces.md) — declare namespaces, import types with `using`, and configure global usings.
91-
- [Assemblies in .NET](../../../standard/assembly/index.md) — learn about assemblies, versioning, and deployment.
92-
- [.NET project SDKs](../../../core/project-sdk/overview.md) — view project file settings including `RootNamespace` and `ImplicitUsings`.
93+
- [Namespaces and using directives](namespaces.md)
94+
- [Assemblies in .NET](../../../standard/assembly/index.md)
95+
- [.NET project SDKs](../../../core/project-sdk/overview.md)

docs/csharp/fundamentals/program-structure/top-level-statements.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
---
22
title: "Top-level statements - programs without Main methods"
33
description: Learn about top-level statements. You can create programs without the ceremony of a Program class and a Main method.
4-
ms.date: 03/13/2026
4+
ms.date: 03/16/2026
5+
ai-usage: ai-assisted
6+
7+
#customer intent: As a C# developer, I want to understand top-level statements so that I can write programs without explicit Main method boilerplate.
8+
59
---
610
# Top-level statements - programs without `Main` methods
711

@@ -65,7 +69,8 @@ The compiler generates a method to serve as the program entry point for a projec
6569

6670
Starting with C# 14, programs can be [*file-based apps*](./index.md#building-and-running-c-programs), where a single file contains the program. You run *file-based apps* by using the command `dotnet <file.cs>`, or by using the `#!/usr/bin/env dotnet` directive as the first line (Unix shells only).
6771

68-
## C# language specification
72+
## Related content
6973

70-
[!INCLUDE[CSharplangspec](~/includes/csharplangspec-md.md)]
71-
[Feature specification - Top-level statements](~/_csharplang/proposals/csharp-9.0/top-level-statements.md)
74+
- [Main() and command-line arguments](main-command-line.md)
75+
- [General structure of a C# program](index.md)
76+
- [Feature specification - Top-level statements](~/_csharplang/proposals/csharp-9.0/top-level-statements.md)

0 commit comments

Comments
 (0)