Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions .github/workflows/whats-new.yml

This file was deleted.

58 changes: 52 additions & 6 deletions .openpublishing.redirection.json
Original file line number Diff line number Diff line change
Expand Up @@ -1386,27 +1386,33 @@
},
{
"source_path": "aspnetcore/whats-new/dotnet-AspNetCore.Docs-2022-03-01.md",
"redirect_url": "/aspnet/whats-new/dotnet-AspNetCore.Docs-mod5"
"redirect_url": "/aspnet/core/release-notes/aspnetcore-10.0",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/whats-new/dotnet-AspNetCore.Docs-2022-04-01.md",
"redirect_url": "/aspnet/whats-new/dotnet-AspNetCore.Docs-mod0"
"redirect_url": "/aspnet/core/release-notes/aspnetcore-10.0",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/whats-new/dotnet-AspNetCore.Docs-2022-07-01.md",
"redirect_url": "/aspnet/whats-new/dotnet-AspNetCore.Docs-mod1"
"redirect_url": "/aspnet/core/release-notes/aspnetcore-10.0",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/whats-new/dotnet-AspNetCore.Docs-2022-08-01.md",
"redirect_url": "/aspnet/whats-new/dotnet-AspNetCore.Docs-mod2"
"redirect_url": "/aspnet/core/release-notes/aspnetcore-10.0",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/whats-new/dotnet-AspNetCore.Docs-2022-09-01.md",
"redirect_url": "/aspnet/whats-new/dotnet-AspNetCore.Docs-mod3"
"redirect_url": "/aspnet/core/release-notes/aspnetcore-10.0",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/whats-new/dotnet-AspNetCore.Docs-2022-10-01.md",
"redirect_url": "/aspnet/whats-new/dotnet-AspNetCore.Docs-mod4"
"redirect_url": "/aspnet/core/release-notes/aspnetcore-10.0",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/blazor/security/webassembly/hosted-with-azure-active-directory.md",
Expand Down Expand Up @@ -1582,6 +1588,46 @@
"source_path": "aspnetcore/introduction-to-aspnet-core.md",
"redirect_url": "/aspnet/core/overview",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/whats-new/index.yml",
"redirect_url": "/aspnet/core/release-notes/aspnetcore-10.0",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/whats-new/dotnet-AspNetCore.Docs-mod0.md",
"redirect_url": "/aspnet/core/release-notes/aspnetcore-10.0",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/whats-new/dotnet-AspNetCore.Docs-mod1.md",
"redirect_url": "/aspnet/core/release-notes/aspnetcore-10.0",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/whats-new/dotnet-AspNetCore.Docs-mod2.md",
"redirect_url": "/aspnet/core/release-notes/aspnetcore-10.0",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/whats-new/dotnet-AspNetCore.Docs-mod3.md",
"redirect_url": "/aspnet/core/release-notes/aspnetcore-10.0",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/whats-new/dotnet-AspNetCore.Docs-mod4.md",
"redirect_url": "/aspnet/core/release-notes/aspnetcore-10.0",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/whats-new/dotnet-AspNetCore.Docs-mod5.md",
"redirect_url": "/aspnet/core/release-notes/aspnetcore-10.0",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/blazor/state-management.md",
"redirect_url": "/aspnet/core/state-management/",
"redirect_document_id": false
}
]
}
4 changes: 2 additions & 2 deletions .whatsnew.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"navigationOptions": {
"maximumNumberOfArticles": 6,
"tocParentNode": "What's new",
"repoTocFolder": "aspnetcore/whats-new",
"repoTocFolder": "/dev/null",
"indexParentNode": "Find ASP.NET Core docs updates",
"repoIndexFolder": "aspnetcore/whats-new"
"repoIndexFolder": "/dev/null"
},
"inclusionCriteria": {
"minAdditionsToFile": 3
Expand Down
11 changes: 7 additions & 4 deletions aspnetcore/blazor/blazor-ef-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,20 @@ public void Dispose() => Context?.Dispose();

<xref:Microsoft.EntityFrameworkCore.DbContextOptionsBuilder.EnableSensitiveDataLogging%2A> includes application data in exception messages and framework logging. The logged data can include the values assigned to properties of entity instances and parameter values for commands sent to the database. Logging data with <xref:Microsoft.EntityFrameworkCore.DbContextOptionsBuilder.EnableSensitiveDataLogging%2A> is a **security risk**, as it may expose passwords and other [Personally Identifiable Information (PII)](xref:blazor/security/index#personally-identifiable-information-pii) when it logs SQL statements executed against the database.

We recommend only enabling <xref:Microsoft.EntityFrameworkCore.DbContextOptionsBuilder.EnableSensitiveDataLogging%2A> for development and testing:
We recommend only enabling <xref:Microsoft.EntityFrameworkCore.DbContextOptionsBuilder.EnableSensitiveDataLogging%2A> for local development and testing:

```csharp
#if DEBUG
if (builder.Environment.IsDevelopment())
{
services.AddDbContextFactory<ContactContext>(opt =>
opt.UseSqlite($"Data Source={nameof(ContactContext.ContactsDb)}.db")
.EnableSensitiveDataLogging());
#else
}
else
{
services.AddDbContextFactory<ContactContext>(opt =>
opt.UseSqlite($"Data Source={nameof(ContactContext.ContactsDb)}.db"));
#endif
}
```

## Additional resources
Expand Down
20 changes: 12 additions & 8 deletions aspnetcore/blazor/call-web-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ When using the interactive WebAssembly and Auto render modes, components are pre
* The client version calls the web API with a preconfigured <xref:System.Net.Http.HttpClient>.
* The server version can typically access the server-side resources directly. Injecting an <xref:System.Net.Http.HttpClient> on the server that makes calls back to the server isn't recommended, as the network request is typically unnecessary. Alternatively, the API might be external to the server project, but a service abstraction for the server is required to transform the request in some way, for example to add an access token to a proxied request.
When using the WebAssembly render mode, you also have the option of disabling prerendering, so the components only render from the client. For more information, see <xref:blazor/components/render-modes#prerendering>.
When using the WebAssembly render mode, you also have the option of disabling prerendering, so the components only render from the client. For more information, see <xref:blazor/components/prerender#disable-prerendering>.
Examples ([sample apps](#sample-apps)):
Expand Down Expand Up @@ -615,25 +615,29 @@ Use ***either*** of the following approaches:
Example: Todo list web API in the `BlazorWebAppCallWebApi` [sample app](#sample-apps)
* If prerendering isn't required for a WebAssembly component that calls the web API, disable prerendering by following the guidance in <xref:blazor/components/render-modes#prerendering>. If you adopt this approach, you don't need to add <xref:System.Net.Http.HttpClient> services to the main project of the Blazor Web App because the component isn't prerendered on the server.
* If prerendering isn't required for a WebAssembly component that calls the web API, disable prerendering by following the guidance in <xref:blazor/components/prerender#disable-prerendering>. If you adopt this approach, you don't need to add <xref:System.Net.Http.HttpClient> services to the main project of the Blazor Web App because the component isn't prerendered on the server.
For more information, see [Client-side services fail to resolve during prerendering](xref:blazor/components/render-modes#client-side-services-fail-to-resolve-during-prerendering).
For more information, see the [Client-side services fail to resolve during prerendering](xref:blazor/components/prerender#client-side-services-fail-to-resolve-during-prerendering) section of the *Prerendering* article.
## Prerendered data
When prerendering, components render twice: first statically, then interactively. State doesn't automatically flow from the prerendered component to the interactive one. If a component performs asynchronous initialization operations and renders different content for different states during initialization, such as a "Loading..." progress indicator, you may see a flicker when the component renders twice.
<!-- UPDATE 10.0 The status of the enhanced nav fix is scheduled for .NET 10.
You can address this by flowing prerendered state using the Persistent Component State API, which the `BlazorWebAppCallWebApi` and `BlazorWebAppCallWebApi_Weather` [sample apps](#sample-apps) demonstrate. When the component renders interactively, it can render the same way using the same state. However, the API doesn't currently work with enhanced navigation, which you can work around by disabling enhanced navigation on links to the page (`data-enhanced-nav=false`). For more information, see the following resources:
<!-- UPDATE 10.0 The enhanced nav update is in for Preview 7.
The preceding paragraph will be updated/
versioned on the upcoming docs Preview 7 PR.
I'll go ahead and remove the PU issue
cross-link on PR #35873.
Note that the README of the "weather" call web API
sample has a cross-link and remark on this, and the
sample app disabled enhanced nav on the weather
component link. -->
You can address this by flowing prerendered state using the Persistent Component State API, which the `BlazorWebAppCallWebApi` and `BlazorWebAppCallWebApi_Weather` [sample apps](#sample-apps) demonstrate. When the component renders interactively, it can render the same way using the same state. However, the API doesn't currently work with enhanced navigation, which you can work around by disabling enhanced navigation on links to the page (`data-enhanced-nav=false`). For more information, see the following resources:
* <xref:blazor/components/prerender#persist-prerendered-state>
* <xref:blazor/state-management/prerendered-state-persistence>
* <xref:blazor/fundamentals/routing#enhanced-navigation-and-form-handling>
* [Support persistent component state across enhanced page navigations (`dotnet/aspnetcore` #51584)](https://github.com/dotnet/aspnetcore/issues/51584)
:::moniker-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ Add a navigation link to the `DaleksMain` component in `NavMenu.razor`:
</div>
```

Because the <xref:Microsoft.AspNetCore.Components.CascadingValueSource%601>'s type in this example (`NotifyingDalek`) is a class type, you can meet virtually any state management feature specification requirement. However, subscriptions create overhead and reduce performance, so benchmark the performance of this approach in your app and compare it to other [state management approaches](xref:blazor/state-management) before adopting it in a production app with constrained processing and memory resources.
Because the <xref:Microsoft.AspNetCore.Components.CascadingValueSource%601>'s type in this example (`NotifyingDalek`) is a class type, you can meet virtually any state management feature specification requirement. However, subscriptions create overhead and reduce performance, so benchmark the performance of this approach in your app and compare it to other [state management approaches](xref:blazor/state-management/index) before adopting it in a production app with constrained processing and memory resources.

Any change in state (any property value change of the class) causes all subscribed components to rerender, regardless of which part of the state they use. **Avoid creating a single large class representing the entire global application state.** Instead, create granular classes and cascade them separately with specific subscriptions to cascading parameters, ensuring that only components subscribed to a specific portion of the application state are affected by changes.

Expand Down Expand Up @@ -517,7 +517,7 @@ Cascading parameters don't pass data across render mode boundaries:

* State crossing the boundary between static and interactive rendering must be serializable. Components are arbitrary objects that reference a vast chain of other objects, including the renderer, the DI container, and every DI service instance. You must explicitly cause state to be serialized from static SSR to make it available in subsequent interactively-rendered components. Two approaches are adopted:
* Via the Blazor framework, parameters passed across a static SSR to interactive rendering boundary are serialized automatically if they're JSON-serializable, or an error is thrown.
* State stored in [`PersistentComponentState`](xref:blazor/components/prerender#persist-prerendered-state) is serialized and recovered automatically if it's JSON-serializable, or an error is thrown.
* State stored in [Persistent Component State](xref:blazor/state-management/prerendered-state-persistence) is serialized and recovered automatically if it's JSON-serializable, or an error is thrown.

Cascading parameters aren't JSON-serializable because the typical usage patterns for cascading parameters are somewhat like DI services. There are often platform-specific variants of cascading parameters, so it would be unhelpful to developers if the framework stopped developers from having server-interactive-specific versions or WebAssembly-specific versions. Also, many cascading parameter values in general aren't serializable, so it would be impractical to update existing apps if you had to stop using all nonserializable cascading parameter values.

Expand Down Expand Up @@ -718,4 +718,4 @@ The following `ExampleTabSet` component uses the `TabSet` component, which conta
## Additional resources

* [Generic type support: Explicit generic types based on ancestor components](xref:blazor/components/generic-type-support#explicit-generic-types-based-on-ancestor-components)
* [State management: Factor out state preservation to a common provider](xref:blazor/state-management?pivots=server#factor-out-state-preservation-to-a-common-provider)
* [State management: Protected browser storage: Factor out state preservation to a common provider](xref:blazor/state-management/protected-browser-storage#factor-out-state-preservation-to-a-common-provider)
2 changes: 1 addition & 1 deletion aspnetcore/blazor/components/data-binding.md
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ Prior to the release of .NET 7, two-way binding across components uses `get`/`se

:::moniker-end

For an alternative approach suited to sharing data in memory and across components that aren't necessarily nested, see <xref:blazor/state-management>.
For an alternative approach suited to sharing data in memory and across components that aren't necessarily nested, see <xref:blazor/state-management/index>.

## Bound field or property expression tree

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ The persisted prerendered state is transferred to the client, where it's used to

## Additional Blazor WebAssembly resources

* [State management: Handle prerendering](xref:blazor/state-management#handle-prerendering)
* [Prerendering support with assembly lazy loading](xref:blazor/webassembly-lazy-load-assemblies#lazy-load-assemblies-in-a-hosted-blazor-webassembly-solution)
* Razor component lifecycle subjects that pertain to prerendering
* [Component initialization (`OnInitialized{Async}`)](xref:blazor/components/lifecycle#component-initialization-oninitializedasync)
Expand Down Expand Up @@ -1064,7 +1063,6 @@ The persisted prerendered state is transferred to the client, where it's used to

## Additional Blazor WebAssembly resources

* [State management: Handle prerendering](xref:blazor/state-management#handle-prerendering)
* [Prerendering support with assembly lazy loading](xref:blazor/webassembly-lazy-load-assemblies#lazy-load-assemblies-in-a-hosted-blazor-webassembly-solution)
* Razor component lifecycle subjects that pertain to prerendering
* [Component initialization (`OnInitialized{Async}`)](xref:blazor/components/lifecycle#component-initialization-oninitializedasync)
Expand Down Expand Up @@ -1322,7 +1320,6 @@ Additional work might be required depending on the static resources that compone

## Additional Blazor WebAssembly resources

* [State management: Handle prerendering](xref:blazor/state-management#handle-prerendering)
* [Prerendering support with assembly lazy loading](xref:blazor/webassembly-lazy-load-assemblies#lazy-load-assemblies-in-a-hosted-blazor-webassembly-solution)
* Razor component lifecycle subjects that pertain to prerendering
* [Component initialization (`OnInitialized{Async}`)](xref:blazor/components/lifecycle#component-initialization-oninitializedasync)
Expand Down
Loading
Loading