Add and update concurrency Not Found coverage - #37650
Merged
guardrex merged 5 commits intoSep 17, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Two moderate documentation issues remain unresolved.
Review details
Suppressed comments (3)
aspnetcore/blazor/fundamentals/navigation.md:383
- This example never assigns an interactive render mode, so it doesn't actually demonstrate the per-page/component case or the prerender-to-interactive transition that
RendererInfo.IsInteractiveis intended to distinguish. Add@rendermode InteractiveServerto a Razor component example (and change the fence accordingly), consistent with the render-mode examples inaspnetcore/blazor/components/render-modes.md:126-135; otherwise readers can copy this into a static component and miss why the condition is required.
When a component is rendered with a per-page/component interactive render mode, calling <xref:Microsoft.AspNetCore.Components.NavigationManager.NotFound%2A> signals the Blazor router to render the `NotFound` component ***only during prerendering*** (<xref:Microsoft.AspNetCore.Components.RendererInfo.IsInteractive?displayProperty=nameWithType>):
```csharp
protected override void OnInitialized()
aspnetcore/blazor/fundamentals/navigation.md:397
- Use a
csharpfence for this block: it contains only a C# method, not Razor markup. The currentrazorfence causes incorrect syntax highlighting and differs from the preceding C# lifecycle example; userazoronly for the complete component examples that include directives or markup.
```razor
aspnetcore/blazor/tutorials/movie-database-app/part-4.md:324
- This workaround is also needed by the identical .NET 10
UpdateMoviesample inaspnetcore/blazor/tutorials/movie-database-app/part-3.md(the concurrency code at lines 766-791), which still callsNotFound()and then falls through toNavigateTo("/movies"). Because Part 3 is encountered before this note in the tutorial, readers can copy the same faulty flow without seeing the fix; please update that sample or add equivalent guidance there as part of this change.
> [!IMPORTANT]
> Due to a bug in the Blazor CRUD template, a `return` statement is missing from the `UpdateMovie` method after <xref:Microsoft.AspNetCore.Components.NavigationManager.NotFound%2A> is called. The purpose of calling `return` is to ensure the handler (the `UpdateMovie` method) selects only the Not Found outcome, independently of a given database provider synchronously or asynchronously executing <xref:Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync%2A>. We're in the process of updating the `Edit` component template, and this article will be updated when the scaffolder generates the correct code.
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
ilonatommy
approved these changes
Sep 16, 2026
guardrex
commented
Sep 16, 2026
Co-authored-by: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com> Co-authored-by: Luke Latham <1622880+guardrex@users.noreply.github.com>
Collaborator
Author
|
Thx, @ilonatommy ... see if that per-page/component language based on your 2nd suggestion works. |
ilonatommy
approved these changes
Sep 17, 2026
ilonatommy
left a comment
Member
There was a problem hiding this comment.
Just typos. (I cannot apply to not to loose approval power 😉 )
Co-authored-by: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com>
ilonatommy
approved these changes
Sep 17, 2026
guardrex
deleted the
guardrex/blazor-movie-db-tutorial-concurrency-updates
branch
September 17, 2026 11:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #37581
Fixes #37623
Thanks @shaunplumb-sue 🚀 for the issue and Ilona 🎷for great assistance ... and patience! 😄
Related: dotnet/Scaffolding#3828
Related: dotnet/blazor-samples#665
In the tutorial, we'll call out manually adding a
returnstatement after theNotFoundcall. There are two explicit notes about the situation that I'll remove when the public fix for dotnet/Scaffolding#3828 goes out.In Part 3, I only mention it in passing because the dev is just reviewing code in Part 3. It's in Part 4's concurrency demo where they'll have trouble with SQLite without the change, and it's in Part 4 that concurrency is discussed in more detail. So, I mention it in Part 3 but have them take action in Part 4.
In the Not Found coverage, we should also remark on placing a
return. I'm not sure if I have it exactly right, but we can start with the draft coverage here.I recommend per what's on the PR that we also roll in some coverage for per-page/component interactive rendering. Not Found works during pre-rendering in this case, so we can call that out because a component might need to toss a 404/Not Found page during component initialization.
Now, I kind'a still would like to show the alternative to the Not Found feature for per-page/component after prerendering. Namely .........
In a given component ...
In the
Programfile ...... but that's up to you, Ilona. If it's too hacky/workaround-ish 😄, then I understand not placing it. I'll keep it in mind in case a dev writes in to ask about it if we don't add it as well.
Right after this merges, I'll go over to the Blazor samples repo and merge dotnet/blazor-samples#665.
After the scaffolder template is updated, I'll circle around and work #37649 to drop the special step in the tutorial to add a
returnstatement.Internal previews
Build report