Skip to content

[11.0 P6] Blazor Preview 6 coverage#37322

Draft
guardrex wants to merge 9 commits into
mainfrom
guardrex/blazor-preview-6
Draft

[11.0 P6] Blazor Preview 6 coverage#37322
guardrex wants to merge 9 commits into
mainfrom
guardrex/blazor-preview-6

Conversation

@guardrex

@guardrex guardrex commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Addresses #37274

🚧👷‍♀️ WIP 👷‍♂️🏗️ ... Only C# unions at this point.

Dan ... Prelim remarks and then a question on the introductory union coverage in the Components overview article ...

Prelim

  • You requested something short, leaving detail to the C# reference, but I'd like to pitch examples that appeal to my inclination to provide a fully working, cut-'n-paste examples that cover a couple of bases, namely ...

    • A C# switched RenderFragment for rendering.
    • An inline Razor syntax switched SlotContent approach for rendering.

    I'll shorten the examples to your liking.

  • The DynamicComponent presentation explains out the boxing requirement with a fully (not 😄) working unboxed case before presenting the correct coding approach. Overkill? Maybe. Let me know if you want that to only show the working approach with merely a passing remark on the boxing requirement.

  • The links used earlier were to the What's New content on unions; but for reference content, we should link the C# reference, which is available now ...

    https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/union

    I leave the What's New link in our What's New coverage (and I place Bill's blog link temporarily in the reference content), but I add the C# reference link to that coverage on this PR. BTW ... that C# What's New link is pointing to the wrong page. It was going to C# 14 content, but I fix that here, too.

❓ Question ❓

Currently, the Components overview article example assigns a C#-built RenderFragment, which works 🎉 ...

<Slot Content="@content" />

@code {
    private SlotContent content;

    protected override void OnInitialized()
    {
        content = new SlotContent((RenderFragment)(b =>
        {
            ...
        }));
    }

...
}

However, I was expecting (hoping for) a Razor markup approach to work ...

<Slot>
    <button @onclick="Increment">@currentCount</button>
</Slot>

... but I couldn't get that to work (even if I named the SlotContent type in the Slot component to "ChildContent").

If there's a Razor markup way to pass that SlotContent, I think we should show it. If it can't be done, then perhaps we should warn devs off of trying it. Otherwise, some folks will probably waste a lot of time trying to get it to work.


Internal previews

📄 File 🔗 Preview link
aspnetcore/blazor/components/dynamiccomponent.md aspnetcore/blazor/components/dynamiccomponent
aspnetcore/blazor/components/index.md aspnetcore/blazor/components/index
aspnetcore/blazor/fundamentals/navigation.md aspnetcore/blazor/fundamentals/navigation
aspnetcore/blazor/fundamentals/routing.md aspnetcore/blazor/fundamentals/routing
aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript
aspnetcore/blazor/javascript-interoperability/call-javascript-from-dotnet.md aspnetcore/blazor/javascript-interoperability/call-javascript-from-dotnet
aspnetcore/blazor/state-management/prerendered-state-persistence.md aspnetcore/blazor/state-management/prerendered-state-persistence
aspnetcore/mvc/models/model-binding.md aspnetcore/mvc/models/model-binding
aspnetcore/signalr/hubs.md aspnetcore/signalr/hubs

@guardrex guardrex self-assigned this Jul 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates ASP.NET Core documentation for .NET 11 Preview 6, focusing on C# union types coverage across Blazor, SignalR, MVC, and Minimal APIs, and aligning union-type links with current C# reference material.

Changes:

  • Update several union-type references to point to the C# union type language reference.
  • Add/expand Blazor guidance for union types (component parameters, DynamicComponent boxing, JS interop support note, and a PCS/serialization caveat).
  • Refresh article metadata dates where substantial content was added/updated.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
aspnetcore/signalr/hubs.md Updates the union types link used in the SignalR JsonHubProtocol note.
aspnetcore/release-notes/aspnetcore-11/includes/csharp-unions-preview-6.md Adds a language-reference cross-link for union types in the .NET 11 Preview 6 release notes include.
aspnetcore/mvc/models/model-binding.md Updates union types link in the model-binding note about [FromBody] support.
aspnetcore/fundamentals/minimal-apis/includes/parameter-binding8-10.md Updates union types link in Minimal API parameter binding note.
aspnetcore/blazor/state-management/prerendered-state-persistence.md Adds a .NET 11 note about JsonSerializerContext not flowing into union deserialization; updates metadata date.
aspnetcore/blazor/javascript-interoperability/call-javascript-from-dotnet.md Adds a .NET 11 note that union types are supported; updates metadata date.
aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md Adds a .NET 11 note that union types are supported; updates metadata date.
aspnetcore/blazor/fundamentals/routing.md Updates union types link in the note about route parameters not supporting unions.
aspnetcore/blazor/fundamentals/navigation.md Updates union types link in the note about [SupplyParameterFromQuery]/[SupplyParameterFromForm] not supporting unions.
aspnetcore/blazor/components/index.md Adds union-typed component parameter guidance + examples and updates metadata (including ai-usage).
aspnetcore/blazor/components/dynamiccomponent.md Adds guidance and examples for boxing union-typed parameters passed via DynamicComponent dictionaries; updates metadata date.

Comment thread aspnetcore/blazor/components/index.md Outdated
Comment thread aspnetcore/blazor/components/index.md Outdated
Comment thread aspnetcore/blazor/components/index.md Outdated
Comment thread aspnetcore/blazor/state-management/prerendered-state-persistence.md
Comment thread aspnetcore/blazor/components/dynamiccomponent.md
guardrex and others added 2 commits July 9, 2026 13:39
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@wadepickett

Copy link
Copy Markdown
Contributor

@guardrex, just a heads up I will be unavailable from 7/10 Friday (tomorrow), all through next week until 7/21. So look to @tdykstra for any reviews you need here or on the samples repo, etc. @tdykstra is also handling the What's New. I'll start a draft today but he will be responsible for updates to keep in sync with any release note updates.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Comment thread aspnetcore/blazor/state-management/prerendered-state-persistence.md Outdated
Comment thread aspnetcore/blazor/javascript-interoperability/call-javascript-from-dotnet.md Outdated
Comment thread aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md Outdated
Comment thread aspnetcore/blazor/components/index.md Outdated
Comment thread aspnetcore/blazor/components/dynamiccomponent.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants