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: CONTRIBUTING.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -188,7 +188,7 @@ DocFX requires:
188
188
189
189
## Voice and tone
190
190
191
-
Our goal is to write documentation that is easily understandable by the widest possible audience. To that end, we established guidelines for writing style that we ask our contributors to follow. For more information, see [Voice and tone guidelines](https://github.com/dotnet/docs/blob/main/styleguide/voice-tone.md) in the .NET repo.
191
+
Our goal is to write documentation that is easily understandable by the widest possible audience. To that end, we established guidelines for writing style that we ask our contributors to follow. For more information, see [Voice and tone guidelines](/contribute/content/dotnet/dotnet-voice-tone).
Copy file name to clipboardExpand all lines: aspnetcore/blazor/components/prerender.md
+3-104Lines changed: 3 additions & 104 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,21 +53,10 @@ To preserve prerendered state, use the `[SupplyParameterFromPersistentComponentS
53
53
54
54
By default, properties are serialized using the <xref:System.Text.Json?displayProperty=fullName> serializer with default settings. Serialization isn't trimmer safe and requires preservation of the types used. For more information, see <xref:blazor/host-and-deploy/configure-trimmer>.
55
55
56
-
The following example demonstrates the general pattern, where the `{TYPE}` placeholder represents the type of data to persist.
56
+
The following counter component persists counter state during prerendering and retrieves the state to initialize the component:
The following counter component example persists counter state during prerendering and retrieves the state to initialize the component.
58
+
* The `[SupplyParameterFromPersistentComponentState]` attribute is applied to the `CounterState` type (`State`).
59
+
* The counter's state is assigned when `null` in `OnInitialized` and restored automatically when the component renders interactively.
71
60
72
61
`PrerenderedCounter2.razor`:
73
62
@@ -252,51 +241,6 @@ Serialized properties are identified from the actual service instance:
252
241
253
242
As an alternative to using the declarative model for persisting state with the `[SupplyParameterFromPersistentComponentState]` attribute, you can use the <xref:Microsoft.AspNetCore.Components.PersistentComponentState> service directly, which offers greater flexibility for complex state persistence scenarios. Call <xref:Microsoft.AspNetCore.Components.PersistentComponentState.RegisterOnPersisting%2A?displayProperty=nameWithType> to register a callback to persist the component state during prerendering. The state is retrieved when the component renders interactively. Make the call at the end of initialization code in order to avoid a potential race condition during app shutdown.
254
243
255
-
The following example demonstrates the general pattern:
256
-
257
-
* The `{TYPE}` placeholder represents the type of data to persist.
258
-
* The `{TOKEN}` placeholder is a state identifier string. Consider using `nameof({VARIABLE})`, where the `{VARIABLE}` placeholder is the name of the variable that holds the state. Using [`nameof()`](/dotnet/csharp/language-reference/operators/nameof) for the state identifier avoids the use of a quoted string.
The following counter component example persists counter state during prerendering and retrieves the state to initialize the component.
301
245
302
246
`PrerenderedCounter3.razor`:
@@ -366,51 +310,6 @@ When the component executes, `currentCount` is only set once during prerendering
366
310
367
311
To preserve prerendered state, decide what state to persist using the <xref:Microsoft.AspNetCore.Components.PersistentComponentState> service. <xref:Microsoft.AspNetCore.Components.PersistentComponentState.RegisterOnPersisting%2A?displayProperty=nameWithType> registers a callback to persist the component state during prerendering. The state is retrieved when the component renders interactively. Make the call at the end of initialization code in order to avoid a potential race condition during app shutdown.
368
312
369
-
The following example demonstrates the general pattern:
370
-
371
-
* The `{TYPE}` placeholder represents the type of data to persist.
372
-
* The `{TOKEN}` placeholder is a state identifier string. Consider using `nameof({VARIABLE})`, where the `{VARIABLE}` placeholder is the name of the variable that holds the state. Using [`nameof()`](/dotnet/csharp/language-reference/operators/nameof) for the state identifier avoids the use of a quoted string.
Copy file name to clipboardExpand all lines: aspnetcore/blazor/host-and-deploy/webassembly/bundle-caching-and-integrity-check-failures.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ When a Blazor WebAssembly app loads in the browser, the app downloads boot resou
20
20
* .NET runtime and assemblies
21
21
* Locale specific data
22
22
23
-
Except for Blazor's boot manifest file (`dotnet.boot.js` in .NET 10 or later, `blazor.boot.json` prior to .NET 10), WebAssembly .NET runtime and app bundle files are cached on clients. The Blazor boot configuration contains a manifest of the files that make up the app that must be downloaded along with a hash of the file's content that's used to detect whether any of the boot resources have changed. Blazor caches downloaded files using the browser [Cache](https://developer.mozilla.org/docs/Web/API/Cache) API.
23
+
Except for Blazor's boot manifest file (`blazor.boot.json`) prior to the release of .NET 10, WebAssembly .NET runtime and app bundle files are cached on clients. The Blazor boot configuration, inlined into `dotnet.js` in .NET 10 or later, contains a manifest of the files that make up the app that must be downloaded along with a hash of the file's content that's used to detect whether any of the boot resources have changed. Blazor caches downloaded files using the browser [Cache](https://developer.mozilla.org/docs/Web/API/Cache) API.
24
24
25
25
When Blazor WebAssembly downloads an app's startup files, it instructs the browser to perform integrity checks on the responses. Blazor sends SHA-256 hash values for DLL (`.dll`), WebAssembly (`.wasm`), and other files in the Blazor boot configuration, which isn't cached on clients. The file hashes of cached files are compared to the hashes in the Blazor boot configuration. For cached files with a matching hash, Blazor uses the cached files. Otherwise, files are requested from the server. After a file is downloaded, its hash is checked again for integrity validation. An error is generated by the browser if any downloaded file's integrity check fails.
Copy file name to clipboardExpand all lines: aspnetcore/blazor/host-and-deploy/webassembly/deployment-layout.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,8 +46,6 @@ The approach demonstrated in this article serves as a starting point for develop
46
46
47
47
The approach described in this article is used by the *experimental*[`Microsoft.AspNetCore.Components.WebAssembly.MultipartBundle` package (NuGet.org)](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.MultipartBundle) for apps targeting .NET 6 or later. The package contains MSBuild targets to customize the Blazor publish output and a [JavaScript initializer](xref:blazor/js-interop/index#javascript-initializers) to use a custom [boot resource loader](xref:blazor/fundamentals/startup#load-boot-resources), each of which are described in detail later in this article.
48
48
49
-
[Experimental code (includes the NuGet package reference source and `CustomPackagedApp` sample app)](https://github.com/aspnet/AspLabs/tree/main/src/BlazorWebAssemblyCustomInitialization)
50
-
51
49
> [!WARNING]
52
50
> Experimental and preview features are provided for the purpose of collecting feedback and aren't supported for production use.
Copy file name to clipboardExpand all lines: aspnetcore/blazor/security/index.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1230,6 +1230,8 @@ To handle the case where the user must satisfy several policies simultaneously,
1230
1230
1231
1231
Claims-based authorization is a special case of policy-based authorization. For example, you can define a policy that requires users to have a certain claim. For more information, see <xref:security/authorization/policies>.
1232
1232
1233
+
If both <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeView.Roles> and <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeView.Policy> are set, authorization succeeds only when both conditions are satisfied. That is, the user must belong to at least one of the specified roles *and* meet the requirements defined by the policy.
1234
+
1233
1235
If neither <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeView.Roles> nor <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeView.Policy> is specified, <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeView> uses the default policy:
The Visual Studio instructions use [SQL Server LocalDB](/sql/database-engine/configure-windows/sql-server-2016-express-localdb), a version of SQL Server Express that runs only on Windows.
Consider downloading and installing a third-party tool for managing and viewing a SQLite database, such as [DB Browser for SQLite](https://sqlitebrowser.org/).
573
573
@@ -1073,11 +1073,11 @@ This is the first in a series of tutorials that show how to use Entity Framework
# Scaffold a data model with dotnet scaffold in a Razor Pages project
15
14
16
15
The CLI tool, [dotnet scaffold](https://www.nuget.org/packages/Microsoft.dotnet-scaffold) creates data access UI for many .NET project types, such as API, Aspire, Blazor, MVC, and Razor Pages. `dotnet scaffold` can be run interactively or as a command line tool via passing parameter values.
@@ -39,7 +38,7 @@ To navigate the UI, use the:
39
38
40
39
## Create and scaffold a data model in a Razor Pages project
41
40
42
-
If you have any problems with the following steps, see [Tutorial: Create a Razor Pages web app with ASP.NET Core](/aspnet/core/tutorials/razor-pages/) and select the **Visual Studio Code** tab.
41
+
If you have any problems with the following steps, see <xref:tutorials/razor-pages/index?tabs=visual-studio-code>.
43
42
44
43
1. Run the following commands to create a Razor Pages project and navigate to the projects folder:
45
44
```dotnetcli
@@ -78,7 +77,7 @@ In The preceding commands:
78
77
79
78
*`dotnet tool uninstall --global dotnet-ef` uninstalls the `dotnet-ef` tool. Uninstalling ensures the latest tool is successfully installed. If `dotnet-ef` isn't installed, an error messages **A tool with the package Id 'dotnet-ef' could not be found.** You can ignore this message.
80
79
*`dotnet tool install --global dotnet-ef` installs globally the `dotnet-ef` tool.
81
-
*`dotnet ef migrations add initialMigration` adds the initial migration. For more information, see [Create the initial database schema using EF's migration feature](/aspnet/core/tutorials/razor-pages/model&tabs=visual-studio-code)
80
+
*`dotnet ef migrations add initialMigration` adds the initial migration. For more information, see <xref:tutorials/razor-pages/model?tabs=visual-studio-code>.
82
81
*`dotnet ef database update` applies the migrations to the database.
83
82
84
83
Run the app:
@@ -94,5 +93,5 @@ Run the app:
94
93
95
94
*[dotnet scaffold repo on GitHub](https://github.com/dotnet/Scaffolding)
96
95
*[How to manage .NET tools](/dotnet/core/tools/global-tools)
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/app-state.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -230,7 +230,7 @@ To enable the session-based TempData provider, use the <xref:Microsoft.Extension
230
230
231
231
A limited amount of data can be passed from one request to another by adding it to the new request's query string. This is useful for capturing state in a persistent manner that allows links with embedded state to be shared through email or social networks. Because URL query strings are public, never use query strings for sensitive data.
232
232
233
-
In addition to unintended sharing, including data in query strings can expose the app to [Cross-Site Request Forgery (CSRF)](https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)) attacks. Any preserved session state must protect against CSRF attacks. For more information, see <xref:security/anti-request-forgery>.
233
+
In addition to unintended sharing, including data in query strings can expose the app to [Cross-Site Request Forgery (CSRF)](https://owasp.org/www-community/attacks/csrf) attacks. Any preserved session state must protect against CSRF attacks. For more information, see <xref:security/anti-request-forgery>.
234
234
235
235
## Hidden fields
236
236
@@ -507,7 +507,7 @@ To enable the session-based TempData provider, use the <xref:Microsoft.Extension
507
507
508
508
A limited amount of data can be passed from one request to another by adding it to the new request's query string. This is useful for capturing state in a persistent manner that allows links with embedded state to be shared through email or social networks. Because URL query strings are public, never use query strings for sensitive data.
509
509
510
-
In addition to unintended sharing, including data in query strings can expose the app to [Cross-Site Request Forgery (CSRF)](https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)) attacks. Any preserved session state must protect against CSRF attacks. For more information, see <xref:security/anti-request-forgery>.
510
+
In addition to unintended sharing, including data in query strings can expose the app to [Cross-Site Request Forgery (CSRF)](https://owasp.org/www-community/attacks/csrf) attacks. Any preserved session state must protect against CSRF attacks. For more information, see <xref:security/anti-request-forgery>.
0 commit comments