Skip to content

Commit 362e581

Browse files
committed
Overview of ASP.NET Core updates
1 parent bcd077a commit 362e581

File tree

10 files changed

+191
-188
lines changed

10 files changed

+191
-188
lines changed

aspnetcore/blazor/advanced-scenarios.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,5 @@ This is a trivial example. In more realistic cases with complex and deeply neste
142142
* The necessary information doesn't exist to permit the framework to generate sequence numbers automatically at runtime unless the information is captured at compile time.
143143
* Don't write long blocks of manually-implemented <xref:Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder> logic. Prefer `.razor` files and allow the compiler to deal with the sequence numbers. If you're unable to avoid manual <xref:Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder> logic, split long blocks of code into smaller pieces wrapped in <xref:Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.OpenRegion%2A>/<xref:Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.CloseRegion%2A> calls. Each region has its own separate space of sequence numbers, so you can restart from zero (or any other arbitrary number) inside each region.
144144
* If sequence numbers are hardcoded, the diff algorithm only requires that sequence numbers increase in value. The initial value and gaps are irrelevant. One legitimate option is to use the code line number as the sequence number, or start from zero and increase by ones or hundreds (or any preferred interval).
145-
* For loops, the sequence numbers should increase in your source code, not in terms of runtime behavior. The fact that, at runtime, the numbers repeat is how the diffing system realises you're in a loop.
145+
* For loops, the sequence numbers should increase in your source code, not in terms of runtime behavior. The fact that, at runtime, the numbers repeat is how the diffing system realizes you're in a loop.
146146
* Blazor uses sequence numbers, while other tree-diffing UI frameworks don't use them. Diffing is far faster when sequence numbers are used, and Blazor has the advantage of a compile step that deals with sequence numbers automatically for developers authoring `.razor` files.

aspnetcore/fundamentals/choose-aspnet-framework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The following table compares ASP.NET Core to ASP.NET 4.x.
3434
|Higher performance than ASP.NET 4.x|Good performance|
3535
|[Use .NET Core runtime](/dotnet/standard/choosing-core-framework-server)|Use .NET Framework runtime|
3636

37-
See [ASP.NET Core targeting .NET Framework](xref:index#target-framework) for information on ASP.NET Core 2.x support on .NET Framework.
37+
See [ASP.NET Core targeting .NET Framework](xref:index#aspnet-core-target-frameworks) for information on ASP.NET Core 2.x support on .NET Framework.
3838

3939
## ASP.NET Core scenarios
4040

aspnetcore/fundamentals/index.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,58 @@ 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+
2173
## Program.cs
2274

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

aspnetcore/fundamentals/minimal-apis/overview.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ uid: fundamentals/minimal-apis/overview
1111

1212
[!INCLUDE[](~/includes/not-latest-version.md)]
1313

14-
Minimal APIs are a simplified approach for building fast HTTP APIs with ASP.NET Core.
15-
You can build fully functioning REST endpoints with minimal code and configuration. Skip traditional scaffolding and avoid unnecessary controllers by fluently declaring API routes and actions. For example, the following code creates an API at the root of the web app that returns the text, `"Hello World!"`.
14+
Minimal APIs are a simplified approach for building fast HTTP APIs with ASP.NET Core. You can build fully functioning REST endpoints with minimal code and configuration. Skip traditional scaffolding and avoid unnecessary controllers by fluently declaring API routes and actions. For example, the following code creates an API at the root of a web app that returns a greeting:
1615

1716
```csharp
1817
var app = WebApplication.Create(args);

aspnetcore/includes/benefits.md

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,77 @@
11
ASP.NET Core provides the following benefits:
22

3-
* A unified story for building web UI and web APIs.
3+
:::moniker range=">= aspnetcore-6.0"
4+
5+
<!-- AUTHOR NOTE: >=6.0 content includes Blazor and Minimal APIs -->
6+
7+
* A unified story for building web apps, web APIs, Azure IoT (Internet of Things) apps, and mobile backends.
8+
* Architected for testability.
9+
* [Blazor](xref:blazor/index) lets you create rich interactive client-side UIs using [.NET](/dotnet/standard/tour)/[C#](/dotnet/csharp/) with wide browser support based on HTML/JavaScript, including mobile browsers. You can also build hybrid desktop and mobile apps with .NET and Blazor.
10+
* [Minimal APIs](xref:fundamentals/minimal-apis) are a simplified approach for building fast web APIs with minimal code and configuration by fluently declaring API routes and actions.
11+
* Supports [Razor Pages](xref:razor-pages/index) and [Model-View-Controller (MVC)](xref:mvc/overview) app development.
12+
* Ability to develop and run on Windows, macOS, and Linux.
13+
* Open-source and [community-focused](https://live.asp.net/).
14+
* Integrate seamlessly with popular client-side frameworks and libraries, including [Angular](/visualstudio/javascript/tutorial-asp-net-core-with-angular), [React](/visualstudio/javascript/tutorial-asp-net-core-with-react), [Vue](/visualstudio/javascript/tutorial-asp-net-core-with-vue), and [Bootstrap](https://getbootstrap.com/).
15+
* Support for hosting Remote Procedure Call (RPC) services using [gRPC](xref:grpc/index).
16+
* A cloud-ready, environment-based [configuration system](xref:fundamentals/configuration/index).
17+
* Built-in [dependency injection](xref:fundamentals/dependency-injection).
18+
* A lightweight, [high-performance](https://github.com/aspnet/benchmarks), and modular HTTP request pipeline.
19+
* Ability to host in the cloud or on-premises with the following:
20+
* [Kestrel](xref:fundamentals/servers/kestrel)
21+
* [IIS](xref:host-and-deploy/iis/index)
22+
* [HTTP.sys](xref:fundamentals/servers/httpsys)
23+
* [Nginx](xref:host-and-deploy/linux-nginx)
24+
* [Docker](xref:host-and-deploy/docker/index)
25+
* [Side-by-side versioning](/dotnet/standard/choosing-core-framework-server#side-by-side-net-versions-per-application-level).
26+
* Tooling that simplifies modern web development.
27+
28+
:::moniker-end
29+
30+
:::moniker range=">= aspnetcore-3.0 < aspnetcore-6.0"
31+
32+
<!-- AUTHOR NOTE: >=3.0 <6.0 content includes Blazor -->
33+
34+
* A unified story for building web apps, web APIs, Azure IoT (Internet of Things) apps, and mobile backends.
435
* Architected for testability.
5-
* [Blazor](xref:blazor/index) lets you use C# in the browser alongside JavaScript. Share server-side and client-side app logic all written with .NET.
6-
* [Razor Pages](xref:razor-pages/index) makes coding page-focused scenarios easier and more productive.
36+
* [Blazor](xref:blazor/index) lets you create rich interactive client-side UIs using [.NET](/dotnet/standard/tour)/[C#](/dotnet/csharp/) with wide browser support based on HTML/JavaScript, including mobile browsers. You can also build hybrid desktop and mobile apps with .NET and Blazor.
37+
* Supports [Razor Pages](xref:razor-pages/index) and [Model-View-Controller (MVC)](xref:mvc/overview) app development.
738
* Ability to develop and run on Windows, macOS, and Linux.
839
* Open-source and [community-focused](https://live.asp.net/).
9-
* Integration of [modern, client-side frameworks](xref:blazor/index) and development workflows.
40+
* Integrate seamlessly with popular client-side frameworks and libraries, including [Angular](/visualstudio/javascript/tutorial-asp-net-core-with-angular), [React](/visualstudio/javascript/tutorial-asp-net-core-with-react), [Vue](/visualstudio/javascript/tutorial-asp-net-core-with-vue), and [Bootstrap](https://getbootstrap.com/).
1041
* Support for hosting Remote Procedure Call (RPC) services using [gRPC](xref:grpc/index).
1142
* A cloud-ready, environment-based [configuration system](xref:fundamentals/configuration/index).
1243
* Built-in [dependency injection](xref:fundamentals/dependency-injection).
1344
* A lightweight, [high-performance](https://github.com/aspnet/benchmarks), and modular HTTP request pipeline.
14-
* Ability to host on the following:
45+
* Ability to host in the cloud or on-premises with the following:
1546
* [Kestrel](xref:fundamentals/servers/kestrel)
1647
* [IIS](xref:host-and-deploy/iis/index)
1748
* [HTTP.sys](xref:fundamentals/servers/httpsys)
1849
* [Nginx](xref:host-and-deploy/linux-nginx)
1950
* [Docker](xref:host-and-deploy/docker/index)
2051
* [Side-by-side versioning](/dotnet/standard/choosing-core-framework-server#side-by-side-net-versions-per-application-level).
2152
* Tooling that simplifies modern web development.
53+
54+
:::moniker-end
55+
56+
:::moniker range="< aspnetcore-3.0"
57+
58+
* A unified story for building web apps, web APIs, Azure IoT (Internet of Things) apps, and mobile backends.
59+
* Architected for testability.
60+
* Supports [Razor Pages](xref:razor-pages/index) and [Model-View-Controller (MVC)](xref:mvc/overview) app development.
61+
* Ability to develop and run on Windows, macOS, and Linux.
62+
* Open-source and [community-focused](https://live.asp.net/).
63+
* Integrate seamlessly with popular client-side frameworks and libraries, including [Angular](/visualstudio/javascript/tutorial-asp-net-core-with-angular), [React](/visualstudio/javascript/tutorial-asp-net-core-with-react), [Vue](/visualstudio/javascript/tutorial-asp-net-core-with-vue), and [Bootstrap](https://getbootstrap.com/).
64+
* Support for hosting Remote Procedure Call (RPC) services using [gRPC](xref:grpc/index).
65+
* A cloud-ready, environment-based [configuration system](xref:fundamentals/configuration/index).
66+
* Built-in [dependency injection](xref:fundamentals/dependency-injection).
67+
* A lightweight, [high-performance](https://github.com/aspnet/benchmarks), and modular HTTP request pipeline.
68+
* Ability to host in the cloud or on-premises with the following:
69+
* [Kestrel](xref:fundamentals/servers/kestrel)
70+
* [IIS](xref:host-and-deploy/iis/index)
71+
* [HTTP.sys](xref:fundamentals/servers/httpsys)
72+
* [Nginx](xref:host-and-deploy/linux-nginx)
73+
* [Docker](xref:host-and-deploy/docker/index)
74+
* [Side-by-side versioning](/dotnet/standard/choosing-core-framework-server#side-by-side-net-versions-per-application-level).
75+
* Tooling that simplifies modern web development.
76+
77+
:::moniker-end

aspnetcore/includes/bind-get.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
> [BindProperty(SupportsGet = true)]
88
> ```
99
>
10-
> For more information, see [ASP.NET Core Community Standup: Bind on GET discussion (YouTube)](https://www.youtube.com/watch?v=p7iHB9V-KVU&feature=youtu.be&t=54m27s).
10+
> For more information, see [ASP.NET Community Standup: Bind on GET discussion (YouTube)](https://www.youtube.com/watch?v=p7iHB9V-KVU&feature=youtu.be&t=54m27s).

0 commit comments

Comments
 (0)