You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/index.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -236,6 +236,58 @@ In Razor `.cshtml` files, `~/` points to the web root. A path beginning with `~/
236
236
237
237
For more information, see <xref:fundamentals/static-files>.
238
238
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
+
#defineTemplateCode// 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
+
#defineExpandDefault// 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
+
#regionsnippet_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:
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).
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/index/includes/index3-7.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -424,4 +424,56 @@ In Razor `.cshtml` files, tilde-slash (`~/`) points to the web root. A path begi
424
424
425
425
For more information, see <xref:fundamentals/static-files>.
426
426
427
+
## How to download a sample
428
+
429
+
Many of the articles and tutorials include links to sample code.
430
+
431
+
1.[Download the ASP.NET repository zip file](https://codeload.github.com/dotnet/AspNetCore.Docs/zip/main).
432
+
1. Unzip the `AspNetCore.Docs-main.zip` file.
433
+
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*.
434
+
435
+
### Preprocessor directives in sample code
436
+
437
+
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.
438
+
439
+
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:
440
+
441
+
```csharp
442
+
#defineTemplateCode// or LogFromMain or ExpandDefault or FilterInCode
443
+
```
444
+
445
+
To change the sample to run the `ExpandDefault` scenario, define the `ExpandDefault` symbol and leave the remaining symbols commented-out:
446
+
447
+
```csharp
448
+
#defineExpandDefault// TemplateCode or LogFromMain or FilterInCode
449
+
```
450
+
451
+
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).
452
+
453
+
### Regions in sample code
454
+
455
+
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.
456
+
457
+
Region names usually contain the word "snippet." The following example shows a region named `snippet_WebHostDefaults`:
458
+
459
+
```csharp
460
+
#regionsnippet_WebHostDefaults
461
+
Host.CreateDefaultBuilder(args)
462
+
.ConfigureWebHostDefaults(webBuilder=>
463
+
{
464
+
webBuilder.UseStartup<Startup>();
465
+
});
466
+
#endregion
467
+
```
468
+
469
+
The preceding C# code snippet is referenced in the topic's markdown file with the following line:
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.
476
+
477
+
For more information, see [Contribute to the ASP.NET documentation: Code snippets](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md#code-snippets).
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/index/includes/index8.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -211,4 +211,56 @@ In Razor `.cshtml` files, `~/` points to the web root. A path beginning with `~/
211
211
212
212
For more information, see <xref:fundamentals/static-files>.
213
213
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
+
#defineTemplateCode// 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
+
#defineExpandDefault// 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
+
#regionsnippet_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:
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).
Copy file name to clipboardExpand all lines: aspnetcore/get-started.md
+34-2Lines changed: 34 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -248,7 +248,39 @@ In this tutorial, you learned how to:
248
248
249
249
:::moniker-end
250
250
251
-
To learn more about ASP.NET Core, see the following:
251
+
To learn more about the fundamentals of ASP.NET Core, see the following:
252
252
253
253
> [!div class="nextstepaction"]
254
-
> <xref:index>
254
+
> <xref:fundamentals/index>
255
+
256
+
## Additional tutorials
257
+
258
+
:::moniker range=">= aspnetcore-6.0"
259
+
260
+
App type | Scenario | Tutorials
261
+
-------- | -------- | ---------
262
+
Web app | New server and client web development with Blazor | <xref:blazor/tutorials/build-a-blazor-app> and <xref:blazor/tutorials/movie-database-app/index>
263
+
Web API | Server-based data processing with Minimal APIs | <xref:tutorials/min-web-api>
Real-time app | Server/client bidirectional communication | <xref:tutorials/signalr>
266
+
267
+
:::moniker-end
268
+
269
+
:::moniker range="< aspnetcore-6.0"
270
+
271
+
App type | Scenario | Tutorials
272
+
-------- | -------- | ---------
273
+
Web app | New server and client web development with Blazor | <xref:blazor/tutorials/build-a-blazor-app> and <xref:blazor/tutorials/movie-database-app/index>
274
+
Web API | Server-based data processing | <xref:tutorials/first-web-api>
0 commit comments