Skip to content

Commit 21d34d0

Browse files
authored
Update Overview of ASP.NET Core (#35847)
1 parent 015ba80 commit 21d34d0

File tree

10 files changed

+286
-337
lines changed

10 files changed

+286
-337
lines changed

.openpublishing.redirection.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@
762762
},
763763
{
764764
"source_path": "aspnetcore/choose-aspnet-framework.md",
765-
"redirect_url": "/aspnet/core/fundamentals/choose-aspnet-framework",
765+
"redirect_url": "/aspnet/core/overview",
766766
"redirect_document_id": false
767767
},
768768
{
@@ -1572,6 +1572,16 @@
15721572
"source_path": "aspnetcore/getting-started/index.md",
15731573
"redirect_url": "/aspnet/core/get-started",
15741574
"redirect_document_id": false
1575+
},
1576+
{
1577+
"source_path": "aspnetcore/fundamentals/choose-aspnet-framework.md",
1578+
"redirect_url": "/aspnet/core/overview",
1579+
"redirect_document_id": false
1580+
},
1581+
{
1582+
"source_path": "aspnetcore/introduction-to-aspnet-core.md",
1583+
"redirect_url": "/aspnet/core/overview",
1584+
"redirect_document_id": false
15751585
}
15761586
]
15771587
}

aspnetcore/fundamentals/choose-aspnet-framework.md

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

aspnetcore/fundamentals/index.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,58 @@ In Razor `.cshtml` files, `~/` points to the web root. A path beginning with `~/
236236

237237
For more information, see <xref:fundamentals/static-files>.
238238

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+
239291
## Additional resources
240292

241293
* <xref:blazor/fundamentals/index>

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

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

425425
For more information, see <xref:fundamentals/static-files>.
426426

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+
#define TemplateCode // 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+
#define ExpandDefault // 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+
#region snippet_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:
470+
471+
```md
472+
[!code-csharp[](sample/SampleApp/Program.cs?name=snippet_WebHostDefaults)]
473+
```
474+
475+
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).
478+
427479
:::moniker-end

aspnetcore/fundamentals/index/includes/index8.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,56 @@ 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
:::moniker-end

aspnetcore/get-started.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,39 @@ In this tutorial, you learned how to:
248248
249249
:::moniker-end
250250

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:
252252

253253
> [!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>
264+
Remote Procedure Call (RPC) app | Contract-first services using Protocol Buffers | <xref:tutorials/grpc/grpc-start>
265+
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>
275+
Remote Procedure Call (RPC) app | Contract-first services using Protocol Buffers | <xref:tutorials/grpc/grpc-start>
276+
Real-time app | Server/client bidirectional communication | <xref:tutorials/signalr>
277+
278+
:::moniker-end
279+
280+
## Additional resources
281+
282+
* [Introduction to .NET](/dotnet/core/introduction)
283+
* [Visual Studio](https://visualstudio.microsoft.com/)
284+
* [Visual Studio Code](https://code.visualstudio.com/)
285+
* [.NET Developer Community](https://dotnet.microsoft.com/platform/community)
286+
* [.NET Live TV](https://live.dot.net)

aspnetcore/includes/benefits.md

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

0 commit comments

Comments
 (0)