Skip to content

Commit 5fb20a5

Browse files
committed
Updates
1 parent 119adc2 commit 5fb20a5

File tree

7 files changed

+253
-293
lines changed

7 files changed

+253
-293
lines changed

aspnetcore/fundamentals/choose-aspnet-framework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ASP.NET Core is a redesign of ASP.NET 4.x. This article lists the differences be
1515

1616
ASP.NET Core is an open-source, cross-platform framework for building modern, cloud-based web apps on Windows, macOS, or Linux.
1717

18-
[!INCLUDE[](~/includes/benefits.md)]
18+
[!INCLUDE[](~/includes/key-features.md)]
1919

2020
## ASP.NET 4.x
2121

aspnetcore/fundamentals/index.md

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -18,59 +18,7 @@ This article provides an overview of the fundamentals for building ASP.NET Core
1818

1919
For Blazor fundamentals guidance, which adds to or supersedes the guidance in this article, see <xref:blazor/fundamentals/index>.
2020

21-
## How to download a sample
22-
23-
Many of the articles and tutorials include links to sample code.
24-
25-
1. [Download the ASP.NET repository zip file](https://codeload.github.com/dotnet/AspNetCore.Docs/zip/main).
26-
1. Unzip the `AspNetCore.Docs-main.zip` file.
27-
1. To access an article's sample app in the unzipped repository, use the URL in the article's sample link to help you navigate to the sample's folder. Usually, an article's sample link appears at the top of the article with the link text *View or download sample code*.
28-
29-
### Preprocessor directives in sample code
30-
31-
To demonstrate multiple scenarios, sample apps use the `#define` and `#if-#else/#elif-#endif` preprocessor directives to selectively compile and run different sections of sample code. For those samples that make use of this approach, set the `#define` directive at the top of the C# files to define the symbol associated with the scenario that you want to run. Some samples require defining the symbol at the top of multiple files in order to run a scenario.
32-
33-
For example, the following `#define` symbol list indicates that four scenarios are available (one scenario per symbol). The current sample configuration runs the `TemplateCode` scenario:
34-
35-
```csharp
36-
#define TemplateCode // or LogFromMain or ExpandDefault or FilterInCode
37-
```
38-
39-
To change the sample to run the `ExpandDefault` scenario, define the `ExpandDefault` symbol and leave the remaining symbols commented-out:
40-
41-
```csharp
42-
#define ExpandDefault // TemplateCode or LogFromMain or FilterInCode
43-
```
44-
45-
For more information on using [C# preprocessor directives](/dotnet/csharp/language-reference/preprocessor-directives/) to selectively compile sections of code, see [#define (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-define) and [#if (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-if).
46-
47-
### Regions in sample code
48-
49-
Some sample apps contain sections of code surrounded by [#region](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-region) and [#endregion](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-endregion) C# directives. The documentation build system injects these regions into the rendered documentation topics.
50-
51-
Region names usually contain the word "snippet." The following example shows a region named `snippet_WebHostDefaults`:
52-
53-
```csharp
54-
#region snippet_WebHostDefaults
55-
Host.CreateDefaultBuilder(args)
56-
.ConfigureWebHostDefaults(webBuilder =>
57-
{
58-
webBuilder.UseStartup<Startup>();
59-
});
60-
#endregion
61-
```
62-
63-
The preceding C# code snippet is referenced in the topic's markdown file with the following line:
64-
65-
```md
66-
[!code-csharp[](sample/SampleApp/Program.cs?name=snippet_WebHostDefaults)]
67-
```
68-
69-
You may safely ignore or remove the `#region` and `#endregion` directives that surround the code. Don't alter the code within these directives if you plan to run the sample scenarios described in the topic.
70-
71-
For more information, see [Contribute to the ASP.NET documentation: Code snippets](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md#code-snippets).
72-
73-
## Program.cs
21+
## `Program.cs`
7422

7523
ASP.NET Core apps created with the web templates contain the application startup code in the `Program.cs` file. The `Program.cs` file is where:
7624

@@ -288,9 +236,61 @@ In Razor `.cshtml` files, `~/` points to the web root. A path beginning with `~/
288236

289237
For more information, see <xref:fundamentals/static-files>.
290238

239+
## How to download a sample
240+
241+
Many of the articles and tutorials include links to sample code.
242+
243+
1. [Download the ASP.NET repository zip file](https://codeload.github.com/dotnet/AspNetCore.Docs/zip/main).
244+
1. Unzip the `AspNetCore.Docs-main.zip` file.
245+
1. To access an article's sample app in the unzipped repository, use the URL in the article's sample link to help you navigate to the sample's folder. Usually, an article's sample link appears at the top of the article with the link text *View or download sample code*.
246+
247+
### Preprocessor directives in sample code
248+
249+
To demonstrate multiple scenarios, sample apps use the `#define` and `#if-#else/#elif-#endif` preprocessor directives to selectively compile and run different sections of sample code. For those samples that make use of this approach, set the `#define` directive at the top of the C# files to define the symbol associated with the scenario that you want to run. Some samples require defining the symbol at the top of multiple files in order to run a scenario.
250+
251+
For example, the following `#define` symbol list indicates that four scenarios are available (one scenario per symbol). The current sample configuration runs the `TemplateCode` scenario:
252+
253+
```csharp
254+
#define TemplateCode // or LogFromMain or ExpandDefault or FilterInCode
255+
```
256+
257+
To change the sample to run the `ExpandDefault` scenario, define the `ExpandDefault` symbol and leave the remaining symbols commented-out:
258+
259+
```csharp
260+
#define ExpandDefault // TemplateCode or LogFromMain or FilterInCode
261+
```
262+
263+
For more information on using [C# preprocessor directives](/dotnet/csharp/language-reference/preprocessor-directives/) to selectively compile sections of code, see [#define (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-define) and [#if (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-if).
264+
265+
### Regions in sample code
266+
267+
Some sample apps contain sections of code surrounded by [#region](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-region) and [#endregion](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-endregion) C# directives. The documentation build system injects these regions into the rendered documentation topics.
268+
269+
Region names usually contain the word "snippet." The following example shows a region named `snippet_WebHostDefaults`:
270+
271+
```csharp
272+
#region snippet_WebHostDefaults
273+
Host.CreateDefaultBuilder(args)
274+
.ConfigureWebHostDefaults(webBuilder =>
275+
{
276+
webBuilder.UseStartup<Startup>();
277+
});
278+
#endregion
279+
```
280+
281+
The preceding C# code snippet is referenced in the topic's markdown file with the following line:
282+
283+
```md
284+
[!code-csharp[](sample/SampleApp/Program.cs?name=snippet_WebHostDefaults)]
285+
```
286+
287+
You may safely ignore or remove the `#region` and `#endregion` directives that surround the code. Don't alter the code within these directives if you plan to run the sample scenarios described in the topic.
288+
289+
For more information, see [Contribute to the ASP.NET documentation: Code snippets](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md#code-snippets).
290+
291291
## Additional resources
292292

293-
* <xref:blazor/fundamentals/index>
293+
<xref:blazor/fundamentals/index>
294294

295295
:::moniker-end
296296

aspnetcore/fundamentals/index/includes/index3-7.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,4 +428,56 @@ In Razor `.cshtml` files, tilde-slash (`~/`) points to the web root. A path begi
428428

429429
For more information, see <xref:fundamentals/static-files>.
430430

431+
## How to download a sample
432+
433+
Many of the articles and tutorials include links to sample code.
434+
435+
1. [Download the ASP.NET repository zip file](https://codeload.github.com/dotnet/AspNetCore.Docs/zip/main).
436+
1. Unzip the `AspNetCore.Docs-main.zip` file.
437+
1. To access an article's sample app in the unzipped repository, use the URL in the article's sample link to help you navigate to the sample's folder. Usually, an article's sample link appears at the top of the article with the link text *View or download sample code*.
438+
439+
### Preprocessor directives in sample code
440+
441+
To demonstrate multiple scenarios, sample apps use the `#define` and `#if-#else/#elif-#endif` preprocessor directives to selectively compile and run different sections of sample code. For those samples that make use of this approach, set the `#define` directive at the top of the C# files to define the symbol associated with the scenario that you want to run. Some samples require defining the symbol at the top of multiple files in order to run a scenario.
442+
443+
For example, the following `#define` symbol list indicates that four scenarios are available (one scenario per symbol). The current sample configuration runs the `TemplateCode` scenario:
444+
445+
```csharp
446+
#define TemplateCode // or LogFromMain or ExpandDefault or FilterInCode
447+
```
448+
449+
To change the sample to run the `ExpandDefault` scenario, define the `ExpandDefault` symbol and leave the remaining symbols commented-out:
450+
451+
```csharp
452+
#define ExpandDefault // TemplateCode or LogFromMain or FilterInCode
453+
```
454+
455+
For more information on using [C# preprocessor directives](/dotnet/csharp/language-reference/preprocessor-directives/) to selectively compile sections of code, see [#define (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-define) and [#if (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-if).
456+
457+
### Regions in sample code
458+
459+
Some sample apps contain sections of code surrounded by [#region](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-region) and [#endregion](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-endregion) C# directives. The documentation build system injects these regions into the rendered documentation topics.
460+
461+
Region names usually contain the word "snippet." The following example shows a region named `snippet_WebHostDefaults`:
462+
463+
```csharp
464+
#region snippet_WebHostDefaults
465+
Host.CreateDefaultBuilder(args)
466+
.ConfigureWebHostDefaults(webBuilder =>
467+
{
468+
webBuilder.UseStartup<Startup>();
469+
});
470+
#endregion
471+
```
472+
473+
The preceding C# code snippet is referenced in the topic's markdown file with the following line:
474+
475+
```md
476+
[!code-csharp[](sample/SampleApp/Program.cs?name=snippet_WebHostDefaults)]
477+
```
478+
479+
You may safely ignore or remove the `#region` and `#endregion` directives that surround the code. Don't alter the code within these directives if you plan to run the sample scenarios described in the topic.
480+
481+
For more information, see [Contribute to the ASP.NET documentation: Code snippets](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md#code-snippets).
482+
431483
:::moniker-end

aspnetcore/fundamentals/index/includes/index8.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,60 @@ In Razor `.cshtml` files, `~/` points to the web root. A path beginning with `~/
211211

212212
For more information, see <xref:fundamentals/static-files>.
213213

214+
## How to download a sample
215+
216+
Many of the articles and tutorials include links to sample code.
217+
218+
1. [Download the ASP.NET repository zip file](https://codeload.github.com/dotnet/AspNetCore.Docs/zip/main).
219+
1. Unzip the `AspNetCore.Docs-main.zip` file.
220+
1. To access an article's sample app in the unzipped repository, use the URL in the article's sample link to help you navigate to the sample's folder. Usually, an article's sample link appears at the top of the article with the link text *View or download sample code*.
221+
222+
### Preprocessor directives in sample code
223+
224+
To demonstrate multiple scenarios, sample apps use the `#define` and `#if-#else/#elif-#endif` preprocessor directives to selectively compile and run different sections of sample code. For those samples that make use of this approach, set the `#define` directive at the top of the C# files to define the symbol associated with the scenario that you want to run. Some samples require defining the symbol at the top of multiple files in order to run a scenario.
225+
226+
For example, the following `#define` symbol list indicates that four scenarios are available (one scenario per symbol). The current sample configuration runs the `TemplateCode` scenario:
227+
228+
```csharp
229+
#define TemplateCode // or LogFromMain or ExpandDefault or FilterInCode
230+
```
231+
232+
To change the sample to run the `ExpandDefault` scenario, define the `ExpandDefault` symbol and leave the remaining symbols commented-out:
233+
234+
```csharp
235+
#define ExpandDefault // TemplateCode or LogFromMain or FilterInCode
236+
```
237+
238+
For more information on using [C# preprocessor directives](/dotnet/csharp/language-reference/preprocessor-directives/) to selectively compile sections of code, see [#define (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-define) and [#if (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-if).
239+
240+
### Regions in sample code
241+
242+
Some sample apps contain sections of code surrounded by [#region](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-region) and [#endregion](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-endregion) C# directives. The documentation build system injects these regions into the rendered documentation topics.
243+
244+
Region names usually contain the word "snippet." The following example shows a region named `snippet_WebHostDefaults`:
245+
246+
```csharp
247+
#region snippet_WebHostDefaults
248+
Host.CreateDefaultBuilder(args)
249+
.ConfigureWebHostDefaults(webBuilder =>
250+
{
251+
webBuilder.UseStartup<Startup>();
252+
});
253+
#endregion
254+
```
255+
256+
The preceding C# code snippet is referenced in the topic's markdown file with the following line:
257+
258+
```md
259+
[!code-csharp[](sample/SampleApp/Program.cs?name=snippet_WebHostDefaults)]
260+
```
261+
262+
You may safely ignore or remove the `#region` and `#endregion` directives that surround the code. Don't alter the code within these directives if you plan to run the sample scenarios described in the topic.
263+
264+
For more information, see [Contribute to the ASP.NET documentation: Code snippets](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md#code-snippets).
265+
214266
## Additional resources
215267

216-
* [WebApplicationBuilder source code](https://github.com/dotnet/aspnetcore/blob/v6.0.1/src/DefaultBuilder/src/WebApplicationBuilder.cs)
268+
[WebApplicationBuilder source code](https://github.com/dotnet/aspnetcore/blob/v6.0.1/src/DefaultBuilder/src/WebApplicationBuilder.cs)
217269

218270
:::moniker-end

0 commit comments

Comments
 (0)